Skip to content

Example: Target All Devices for an OS

// do not forget to call Backendless.initApp in the app initialization code

DeliveryOptions deliveryOptions = new DeliveryOptions();

deliveryOptions.setPushBroadcast( PushBroadcastMask.ANDROID | PushBroadcastMask.IOS );

PublishOptions publishOptions = new PublishOptions();
publishOptions.putHeader( "android-ticker-text", "You just got a push notification!" );
publishOptions.putHeader( "android-content-title", "This is a notification title" );
publishOptions.putHeader( "android-content-text", "Push Notifications are cool" );

MessageStatus status = Backendless.Messaging.publish( "Hi Devices!", 
                                                      publishOptions, 
                                                      deliveryOptions );