notificationEnableDisable.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (isChecked) {
register();
} else {
unregister();
}
});
//To Turnon receiving Braze notifications in Android app...void register() {
// Need to register push notifications with current device token com.package.Appboy appboy = com.package.Appboy.getInstance(context);
String deviceToken = FirebaseInstanceId.getInstance().getToken();
if (Strings.isNonEmpty(deviceToken)) {
appboy.registerAppboyPushMessages(deviceToken);
}
}
//To Turnoff receiving Braze notifications in Android app...void unregister() {
com.package.Appboy appboy = com.package.Appboy.getInstance(context);
AppboyUser user = appboy.getCurrentUser();
if (user != null) {
user.setPushNotificationSubscriptionType("unsubscribed");
}
}
Translate
Thursday, April 30, 2020
Android code to turn-on/Enable and turn-off/Disable receiving Braze push/silent notifications in Android device
Subscribe to:
Post Comments (Atom)
Could not identify launch activity: Default activity not found : Error while Launching activity
Problem : I got this Error , When I tried to create an application without any Activity . Basically like to develop an Android Headless appl...
-
Audio Focus Android O – 26.0 : https://developer.android.com/guide/topics/media-apps/audio-focus.html#audio-focus-change...
-
down vote Following is the fix for AndroidStudio 3.1.2 OR Newer Versions : We have faced the same issue on AS 3.1.2 , but a simp...
-
PHP is a server side scripting language. Php is for fetching data from the datastore, perform bussiness logics, then dump the necessary htm...
No comments:
Post a Comment