Skip to content

Send Notification from a Push Template

Blocking API

// sending a push notification using template name
MessageStatus msgStatus = Backendless.Messaging.pushWithTemplate( "TemplateName" );

// sending a push notification for a template that has custom substitution variables:
MessageStatus msgStatus = Backendless.Messaging.pushWithTemplate( "TemplateName", Map<String, String> templateValues );

Non-blocking API

Backendless.Messaging.pushWithTemplate( "TemplateName", 
                                         AsyncCallback<MessageStatus> responder  );

Backendless Console includes a code generator which creates the client-side code for publishing a push notification for a template. To access the code generator, login to Backendless Console, select your app and click the Messaging icon. Select the PUSH NOTIFICATION tab and click the Push Templates menu. There is the "show code" icon for each created template as shown below. When you click the icon, a popup is displayed with the generated code:

generate-code-push-template.zoom70

The displayed popup lets you select the client-side language and copy the generated code:
push-template-generated-code