Amplify on launch requests permission for notifications, which is undesirable
See original GitHub issueDescribe the bug
When launching an iOS React Native application the user is immediately asked to enable push notifications. This happens, I believe, because Amplify.configure()
eventually calls PushNotification.initializeIOS()
.
To Reproduce
Create an iOS React Native application and run Amplify.configure()
.
Expected behavior Request permission to send notifications later, when needed. e.g., after an onboarding flow, sign-in, etc.
Smartphone (please complete the following information):
- Device: iPhone 8
- OS: iOS 12.0
Additional context
It would be nice if this were removed from PushNotification.initializeIOS()
:
PushNotificationIOS.requestPermissions({
alert: true,
badge: true,
sound: true
});
And instead were a separate method (e.g., PushNotification.requestPermissionsIOS()
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Notifications - AWS Amplify Hosting
Use notifications to alert stakeholders when an Amplify app build succeeds or fails.
Read more >APNs Push Notifications for iOS Using AWS Lambda in Swift
Kilo Loco covers the end to end process of setting up APNs Push Notifications using AWS Amplify and AWS Lambda all in Swift....
Read more >Use notifications to get alerts - Computer - Google Chrome Help
Important: If you allowed notifications for a site that Chrome marked as abusive or misleading, Chrome may block those notifications and require the...
Read more >Send an SMS to Customers Using React and AWS Amplify
When it comes to sending push notifications, email, or SMS, AWS has a service known as Amazon Simple Notification Service or SNS. In...
Read more >Android 13 Developer Preview: Push Opt-Ins Arrive for ... - Braze
What's changing for push notifications in Android 13 ... 13 will now need to request permission from the user before posting notifications,” ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I submitted my own PR #2697 to add this functionality because my team also needs it for our app. I used the config option approach to maintain backward compatibility as requested. Please let me know if it looks ok, @powerful23
The way it works is that you configure PushNotification to not automatically request permissions:
Then later when you are ready to request the permission, you can manually call this method:
After you allow the permission in the app, the device token will be received by the library.
Hope this helps.
Any progress with this? 😀