Comments (5)
Hello, @seokjeatuiti 👋. Can you clarify what version of Android you're using and if you're seeing this on both physical devices and emulators? I wasn't able to reproduce this on more recent versions of Android, so if you could also provide your frontend code that's reproducing this issue it would be appreciated! I think we need to know where you're calling the Push Notification API's in the notification lifecycle/state of the app.
from amplify-js.
Thank you for answer! We have provided answers for each item you asked.
Can you clarify what version of Android you're using and if you're seeing this on both physical devices and emulators?
Yes it's happening on both physical device and emulator.
- Physical device: Android 14 (Galaxy S23+, Galaxy A53)
- Emulator: Pixel 2 API 33
I wasn't able to reproduce this on more recent versions of Android, so if you could also provide your frontend code that's reproducing this issue it would be appreciated!
When notifications were being cut off, the settings were as follows.
For reference, We provide both OTP for general users and USER_SRP_AUTH authentication methods for employees.
import { Amplify } from '@aws-amplify/core';
import awsConfig from './aws-exports';
import { Auth, Notifications, Analytics } from 'aws-amplify';
Amplify.configure({
...awsConfig,
Auth: {
authenticationFlowType: 'USER_SRP_AUTH',
},
Analytics: {
disabled: false
},
});
Notifications.Push.enable();
};
I was suspicious that Analytics might be causing a problem with the endpoint, so I added Analytics.disable()
, notifications started coming in fine from then on. I referred to this document.
Amplify.configure({
...awsConfig,
Auth: {
authenticationFlowType: 'USER_SRP_AUTH',
},
// Analytics: {
// disabled: false
// },
});
Analytics.disable();
Notifications.Push.enable();
};
The identifyUser part is as follows.
optOut
is not separately specified in the v5 official document, but when this part was excluded at first, there was a problem with the endpoint being created as optOut: All
.
export const updatePushToken = async (userId: string) => {
const token = await AsyncStorage.getItem('pinpointToken');
if (token) {
try {
const userProfile: AWSPinpointUserInfo = {
optOut: 'NONE',
};
await Notifications.Push.identifyUser(userId, userProfile);
} catch (e) {
console.error('updateEndpoint ERR', e);
}
}
};
I think we need to know where you're calling the Push Notification API's in the notification lifecycle/state of the app
We are sending notifications using pinpoint SDK through Lambda. There doesn't seem to be any particular problem in this part.
const AWS = require('aws-sdk');
const pinpoint = new AWS.Pinpoint({ region: 'us-west-2' });
...
const defaultMessage = {
Action: 'OPEN_APP',
Body: message,
SilentPush: false,
Title: senderName || '{Service Name}',
Data: {
conversationID,
},
};
const sendMessagesParams = {
ApplicationId: projectId,
SendUsersMessageRequest: {
Users: notifiedUsers,
MessageConfiguration: {
DefaultPushNotificationMessage: {
...defaultMessage,
},
APNSMessage: {
Badge: 1,
Priority: '10',
Sound: 'default',
ThreadId: senderId,
},
GCMMessage: {
Priority: 'high',
Sound: 'default',
},
},
},
};
await new Promise((resolve, reject) => {
pinpoint.sendUsersMessages(
sendMessagesParams,
(sendMessagesErr, sendMessagesData) => {
if (sendMessagesErr) {
reject(sendMessagesErr);
}
if (sendMessagesData) {
resolve(sendMessagesData);
}
},
);
});
}
By the way, this is an old post, but I experienced a similar problem once in the past, and registered an issue at that time. Please note.
from amplify-js.
Hello, I am encountering the same problem. Here are the CloudWatch logs:
2024-03-29T16:30:45.379Z 6a9370ac-fa6e-5925-8e45-2e2c148de650 INFO recipientResult { 'f1c91d2a-1236-408e-9d89-823185a51140': { DeliveryStatus: 'PERMANENT_FAILURE', StatusCode: 410, StatusMessage: '{"errorMessage":"Unregistered or expired token","channelType":"GCM","pushProviderStatusCode":"200","pushProviderError":"NotRegistered","pushProviderResponse":"{\\"multicast_id\\":\\"2421628289060879526\\",\\"success\\":0,\\"failure\\":1,\\"canonical_ids\\":0,\\"results\\":[{\\"error\\":\\"NotRegistered\\"}]}"}', Address: 'e5J1QAnFTPC0UmggiGi2qr:APA91bH3bGv5G4AsKWX6uPqiH7_uSEe0y_SxDBLDl09r8XehJUaX9Pl3RcIGoZZ6D-pWX3qVAhykeNgCFMuF6Mosy9qL20TzBiP8zXN6zbHj88iO64TGjBTWWBu4dTFqgwOj6c--kys9' }, '5b13560a-f123-42d5-a58d-d04768d9246c': { DeliveryStatus: 'PERMANENT_FAILURE', StatusCode: 410, StatusMessage: '{"errorMessage":"Unregistered or expired token","channelType":"GCM","pushProviderStatusCode":"200","pushProviderError":"NotRegistered","pushProviderResponse":"{\\"multicast_id\\":\\"6799976235612541133\\",\\"success\\":0,\\"failure\\":1,\\"canonical_ids\\":0,\\"results\\":[{\\"error\\":\\"NotRegistered\\"}]}"}', Address: 'eOZAYcL7SdaJiEyflrezSi:APA91bEsxIdFA0Gxk64sZ-m9L_5LZkbmn-mmQhAu4tC1tXZ4QGm-KSDZjosqeJg-qXvXJn4Y1inNdc9ygzZTImZN50OWkvJ0udQjLHwWC7J_BOB7DeIwQvjvo9aIjOsmPWLTYbFxtB86' }, '35124492-4045-4a64-99fb-cb2774b05a00': { DeliveryStatus: 'PERMANENT_FAILURE', StatusCode: 410, StatusMessage: '{"errorMessage":"Unregistered or expired token","channelType":"GCM","pushProviderStatusCode":"200","pushProviderError":"NotRegistered","pushProviderResponse":"{\\"multicast_id\\":\\"1526660718498104442\\",\\"success\\":0,\\"failure\\":1,\\"canonical_ids\\":0,\\"results\\":[{\\"error\\":\\"NotRegistered\\"}]}"}', Address: 'eC-us18cQxaLZHJ__m7bEz:APA91bHaV6Y9P1aqo34fxgnyCnOun_13F0w4h2sE8VtDnieZMaj2srZbqwtkkuLTt72sF0F5o9_ebzH9Qn6JdnNdDUJzOoBIm3jtNBf3fElFYOpVrZoEzRnSBc2HpY2VWljOESD0YMZv' }, 'cc0b8944-2ccf-4fa0-8ca2-e36c4986a7cc': { DeliveryStatus: 'PERMANENT_FAILURE', StatusCode: 410, StatusMessage: '{"errorMessage":"Unregistered or expired token","channelType":"GCM","pushProviderStatusCode":"200","pushProviderError":"NotRegistered","pushProviderResponse":"{\\"multicast_id\\":\\"3866949699306559810\\",\\"success\\":0,\\"failure\\":1,\\"canonical_ids\\":0,\\"results\\":[{\\"error\\":\\"NotRegistered\\"}]}"}', Address: 'ejd8IArJSy2-WLmp1IzxEw:APA91bGpOcYzg8QsGqFvTq0-hec_wDh-XIb5hP9Btq5Og1Y-_vO1NtxlWIzD6va-wUiBODwrIoK6oa9-_hl84cJiaMLzGeVCIeU-zAtuuzrioqlb4n06kRHJQDLrr9gt3GiOjTXczVl6' } }
from amplify-js.
@seokjeatuiti, is the token address in the error messages is the same one that you are using to send from the Firebase console? Any chance you can you share a couple of failures from the same device if possible? Curious to see if the errors are all showing the same address (or if anything changes).
from amplify-js.
@cwomack, Every time I started a new test, I deleted all endpoints using cli to ensure a clean experiment. Of course, since the token address newly created on the device was used during the Firebase Console test, it is unlikely that the token address in the two environments changed or was altered before or after the test.
The gist of what I posted was that the endpoint would be deleted after sending 1-2 messages, and that PERMANENT_FAILURE would be displayed when looking up the endpoint information through cli. It's not a problem with the token address. Fortunately, nothing special has happened since adding Analytics.disable()
(Please refer to the above).
In my opinion, this problem appears to have been caused by anomalous use of the Analytics module that does not match the version. I don't think we need to spend any more time on this issue. Therefore, I will close the ticket. Anyway, thank you.
from amplify-js.
Related Issues (20)
- amplify/auth resetPassword succeeds but customSmsSender trigger lambda never called HOT 3
- Federated Sign-in - App Sync list query Auth Error HOT 2
- Amplify not works well if I have configuring multiple user pools with condition
- Next, js, Amplify js.fetchAuthSession({forceRefresh: true}) does not work as expected and returns tokens as undefined. How to manage a refresh token in Amplify v6 in Next.js HOT 4
- Amplify CLI Gen 2 - Multiple SortKeys combined into one input with GraphQL Generation HOT 5
- AWS storage upload issue HOT 2
- Datastore.save() sending _version of previous query model instead of current model. HOT 2
- runWithAmplifyServerContext throwing error, ⨯ Error: Cannot access Cognito.length on the server. You cannot dot into a client module from a server component. You can only pass the imported name through. HOT 4
- 6.3.3 is stable ? HOT 1
- ResizeObserver loop when navigating in the Authenticator component HOT 1
- [v6] resetPassword not trigger UserMigration lambda HOT 2
- Add timeout on GET and POST api calls for amplify v6 HOT 2
- No federated JWT token when using AppSync OIDC in Amplify Gen2 HOT 5
- Permission denied - allow.authenticated() HOT 6
- [v6] sendUserAttributeVerificationCode not send code to destination email HOT 5
- MD5 not calculating correctly when selecting file from broswer, failing with BadDigest Error HOT 4
- Auth.SignIn not allowing username only signin HOT 2
- `Hub.listen` not firing when inside `useEffect` HOT 14
- Hub should automatically fire `tokenRefresh` event through Hub HOT 1
- Google login in react native requires two login attempts to work only on production ANDROID HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-js.