Closed stefoid closed 1 week ago
Hello, @stefois 👋. Can you confirm if this was an upgraded/migrated app from a previous version (e.g. Amplify v4 or v5)? If so, can you see if taking the following steps helps resolve the issue?
package-lock.json
filenode_modules
foldernpm i
If that doesn't help at all, can you share your frontend code where Push Notifications is being used/set up? Thanks.
Hi - to be clear, this bug affects a small percentage of users, sometimes. Potentially the only consistent aspect is it affects android users. Its not something I can replicate myself in my local environment. Our production builds are always from a clean foundation, so those steps (removing node_modules etc...) are not required.
import { initializePushNotifications, getPermissionStatus, onTokenReceived, onNotificationReceivedInForeground, onNotificationOpened, getLaunchNotification, requestPermissions} from 'aws-amplify/push-notifications';
import { Amplify } from 'aws-amplify';
function configure () {
Amplify.configure({
Notifications: {
Push: {
AWSPinpoint: {
appId: 'com.xxx.xxxxx',
region: 'ap-southeast-2'
}
}
}
});
initializePushNotifications();
// // get the registration token
// This will only be triggered when the token is generated or updated.
onTokenReceived((token) => {
saveToken(token)
});
onNotificationReceivedInForeground((notification) => {
handleNotification(notification)
});
onNotificationOpened((notification) => {
handleNotification(notification)
});
}
@stefoid, we see Push Notifications working as expected on our side and can't reproduce the issue you're running in to.
There might be a few related issues within the React Native repo (see here) tied to Android crashes happening based on different client environments, versions, etc. If you can find a way to reproduce this consistently or provide can provide a sample repo that does, definitely let us know so we can dig into it further and reopen. For now, we'll close this issue until there's a way to consistently reproduce.
OK, Ill keep an eye on it.
So there is nothing you can gatehr from inspecting the code in this file?
at com.amazonaws.amplify.rtnpushnotification.PushNotificationModule.shouldShowRequestPermissionRationale(PushNotificationModule.kt:186)
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Push Notifications
Amplify Version
v6
Amplify Categories
notifications
Backend
None
Environment information
Describe the bug
Ive noticed in crashlytics that a small proportion of our users are experiencing this crash bug always at startup.
All I have to go on are the stack traces below. this appears to only be reporting for android devices, but we have few iOS users so I cant guarentee you 100% that it is Android-only.
Expected behavior
no crash
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
android devices (probably)
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
e
Additional information and screenshots
No response