Adobe Air > Advanced

Customizing notifications

Managing Android notification display

You can restrict notification display on Android with several parameters such as disabling sound, vibration, or simply disabling notifications for that user if you have a way to ask for opt-in.

Batch Push provides you with an enum with the interactions a notification can have via: PushNotificationType. This enum contains ALERT, SOUND, LIGHTS and VIBRATE. By default, everything is activated.

Disabling notifications:

BatchPush.setAndroidNotificationTypes(AndroidNotificationType.NONE);

You can call BatchPush.setAndroidNotificationTypes whenever you want in the runtime of your application.

Disabling sound:

BatchPush.setAndroidNotificationTypes(AndroidNotificationType.ALERT | AndroidNotificationType.VIBRATE | AndroidNotificationType.LIGHTS);

Please keep in mind that once you've set notification type within Batch, you have to set it again to change it.