-
Notifications
You must be signed in to change notification settings - Fork 17
Android 13 Notification Permission Handling
Starting from Android 13, Google requires to ask user for notification permission. More information can be found on official Android documentation.
MobileMessaging SDK will automatically ask user for Push Notification Permission starting from Android 13+. It is possible to disable this default behaviour. This might be needed in case your app should support other push notifications vendors in addition to (or instead of) Infobip's one, or you want to have a more flexible approach of when and where the user will be prompted to allow receiving Push Notifications.
In order to not ask automatically Push Notification Permission, it is possible to use withoutRegisteringForRemoteNotifications()
method:
MobileMessaging
.Builder(application)
.withoutRegisteringForRemoteNotifications()
.build()
expand to see Java code
new MobileMessaging
.Builder(getApplication())
.withoutRegisteringForRemoteNotifications()
.build();
To trigger notification permission request at any time, the following code should be invoked:
MobileMessaging.getInstance(context).registerForRemoteNotifications()
expand to see Java code
MobileMessaging.getInstance(context).registerForRemoteNotifications();
If user does not accept Notification Permission Request, he won't be able to receive push notifications. In order to enable push notifications, user needs to be redirected to the Phone Settings and needs to enable Notifications permission.
If you have any questions or suggestions, feel free to send an email to support@infobip.com or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
Geofencing API- DEPRECATED- Android Manifest components
- Privacy settings
- In-app chat
- Infobip RTC calls and UI
- Backup rules