About Push Templates¶
A Push Template defines all aspects of a push notification which will be generated based on the template and delivered to the audience defined in the template. Both the content and the audience can be dynamic, as a result, the same template can result in a push notification delivered to different set of users depending on the condition in your application. The dynamic nature of the content is implemented using the Smart Text technology. Read more about smart text in Notification Content section of this guide.
A template can be created using Backendless Console with an easy to use and very intuitive interface (see the Push Composer section for more details). A template has a name that must be used when publishing a Push Notification based on the template.
Push Template Structure¶
A Push Template has the following structure. Each blocks is described in details below:
See below for an overview of each block/section in the diagram:
Push Notification Content¶
Push notification content in a template includes text message, title, subtitle. For more information see the Notification Content section.
This defines who will be receiving the notification, such as all Android and/or iOS devices, subscribers of a specific messaging channel or a custom user segment. For more information see the Notification Audience section.
Look & Feel Options¶
Available options vary between Android and iOS push notifications. Cumulatively the options include icon and/or image in the notification, sound, title color, notification self-cancellation and the option to deliver as silent notifications. The example below features a custom color for the name of the app and a custom icon:
This is a a reference to a button options configuration which defines buttons included into the notifications created from the push template. Backendless app developer/admin can create multiple button option configurations and reference one in a Push Template. For more information about button templates see the About Button Options section.
Channel Options (Android only)
Push notifications delivered by Backendless to Android devices can include Android notification channel configuration. The configuration is defined through Channel Options shown in the screenshot below. The same channel template can be reused in different push templates. For more information about channel options configuration settings see the About Channel Templates section.
Push Template Management¶
Push Templates can be managed using Backendless Console with the Push Templates screen available in the Messaging section under PUSH NOTIFICATIONS tab. All push templates created using the Compose Push section and saved there will appear in the listing shown below:
For any shown push template you can perform the following actions:
Edit a Template¶
Generate API for a Template¶
Get the generate code for different languages to publish a push notification for the template. A push template can be used to publish a push notification with an API call simply by referencing the template name. Since a template contains both the content (which can be dynamic) and the audience definition, Backendless can create and deliver push notifications knowing just the push template name:
The displayed popup lets you select the client-side language and copy the generated code:
Schedule Automated Delivery¶
Clicking the icon opens up the Business Logic interface for creating a timer. Using the interface you can create a custom schedule for when the push notification needs to be published, including a single push notification delivery in the future or a recurring delivery according to a schedule.
Keep in mind that creating a scheduled push notification delivery results in allocating a business logic timer, which is a resources accounted for in Backendless Cloud billing. Check the payment plan your application is on to know the limit for the business logic scripts (which include timers).