-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Credentials Generated for Android Device and No Error #13277
Comments
Hello, @SwhiteMHC. I've got a couple of suggestions to see if we can unblock you here and determine the root cause. Also, the |
Hi @cwomack That worked in the minimally reproducible example. However, I recreated this example app because of an issue with another application. Making this change in the other application does not solve the problem. I have been digging into the code and observe this:
Interesting enough. I can take the token from the onHostResume() and test the push notification using Amazon Pinpoint Test Messaging, and the device successfully receives the notification.
Any thoughts? |
@SwhiteMHC, are you using Expo Go by chance? And if I'm understanding the above comment properly, it worked in the sample app you provided to make the changes suggested? As for the other application that's experiencing this problem, are you able to share a sample repo or code that can be reviewed there as well? |
@SwhiteMHC, wanted to check in and see if you're still experiencing this and saw the questions above. |
@cwomack Thanks for reaching out. The error is still occurring. As a work around, I am directly importing @react-native-firebase/messaging and making a call to getToken() for the time being. |
@cwomack I am experiencing this issue as well. Any thoughts on how to correct? |
@SwhiteMHC I'm experiencing the same issue and unable to solve it - but used the workaround and it is working. |
@SwhiteMHC Thank you for providing the reproducible app, I was only able to reproduce the same "No credentials" error when I had the code you had for configuring Amplify, Amplify.configure({
Auth: {
Cognito: {
userPoolId: '',
userPoolClientId: '',
identityPoolId: '',
},
},
Notifications: {
PushNotification: {
Pinpoint: {
appId: '',
region: '',
},
},
},
Analytics: {
Pinpoint: {
appId: '',
region: '',
},
},
}); Do you still see the same error after populating these fields? When I used the configuration file directly the error went away and everything worked as expected. I used, import awsMobile from './aws-exports';
Amplify.configure(awsMobile); |
@Samaritan1011001 Switching to aws-exports stops the No Credential error, however the onTokenReceived event never fires and I dont have access to the token. |
@SwhiteMHC thanks for confirming. In that case, I believe this is a backend setup issue since my To debug if the backend for PN is setup properly, can you verify the following Android setup steps were completed? Finally, is your app a new one or are you upgrading from an older RN version? |
@SwhiteMHC, wanted to circle back and see if you had a chance to review @Samaritan1011001's comment/questions above. Let us know if you're still experiencing this issue. |
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue. Thank you! |
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Push Notifications
Amplify Version
v6
Amplify Categories
auth, notifications
Backend
Amplify CLI
Environment information
Describe the bug
onTokenReceived event, and subsequently the handler, never fires when running on an Android Device.
Expected behavior
onTokenReceivedHandler receives new token, and token is accessible for storage and registration with Amazon Pinpoint.
Reproduction steps
I followed the setup instructions for AWS-Amplify Push Notifications for a completely new React-Native-CLI project: https://docs.amplify.aws/react-native/build-a-backend/push-notifications/set-up-push-notifications/
Minimal Reproducible Example: https://github.com/SwhiteMHC/amplify-fail-android
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
Amplify.configure({
Auth: {
Cognito: {
userPoolId: '',
userPoolClientId: '',
identityPoolId: '',
},
},
Notifications: {
PushNotification: {
Pinpoint: {
appId: '',
region: '',
},
},
},
Analytics: {
Pinpoint: {
appId: '',
region: '',
},
},
});
Additional configuration
Mobile Device
Galaxy A14 5G
Mobile Operating System
Android 14
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
The text was updated successfully, but these errors were encountered: