Upgrading to Android SDK v4.3.0 to support Android 13
Target Android SDK 33+
In your app's build gradle file, make sure targetSdkVersion
and compileSdkVersion
are at least 33
.
android {
compileSdkVersion 33
defaultConfig {
targetSdkVersion 33
Prompt users for push permission
Calling subscribeToNotifications
subscribeToNotifications
Android 13 requires users to accept a push permission prompt in order to receive push notifications.
To trigger this prompt, you must call WonderPush.subscribeToNotifications()
at the right time in your user's journey.
// Shows the push permission prompt when necessary
WonderPush.subscribeToNotifications();
// You can also use this variation that will show an alert dialog
// to users who have repeatedly denied the permission, taking them to the settings
// of your app where they can flip the permission switch:
WonderPush.subscribeToNotifications(true);
// Shows the push permission prompt when necessary
WonderPush.subscribeToNotifications();
// You can also use this variation that will show an alert dialog
// to users who have repeatedly denied the permission, taking them to the settings
// of your app where they can flip the permission switch:
WonderPush.subscribeToNotifications(true);
// Shows the push permission prompt when necessary
WonderPush.subscribeToNotifications();
// You can also use this variation that will show an alert dialog
// to users who have repeatedly denied the permission, taking them to the settings
// of your app where they can flip the permission switch:
WonderPush.subscribeToNotifications(true);
Using a Popup
You can also use a Popup to trigger the push notification permission prompt.
Updated about 2 years ago