Android Push Notification Templates

Use different template designs for your push notifications as per the content.

Starting version 1.3.3 for the Native Android SDK, version 2.0.0 for the Flutter plugin and version 2.0.4 for the React Native plugin, you would be able to use different template designs for your push notifications as per the content being sent in the campaigns.

NewsRoom Template

The Android NewsRoom template ensures that the background image covers the entire available surface area of the push notification with zero bezels. All the text is overlaid on the image. This works in both expanded and collapsed views.

337337

This template is available for use which focuses on the Title & the Banner Image only to provide a bezel-less experience to your end-users.

In order to use this custom template, you can use the below method in the main Application class:

import com.izooto.iZooto;
import com.izooto.PushTemplate;

public class MyApplicationName extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    iZooto.initialize(this).build();
    iZooto.setDefaultTemplate(PushTemplate.TEXT_OVERLAY);
  }
}
iZooto.setDefaultTemplate(PushTemplate.TEXT_OVERLAY);
import { PushTemplate } from 'react-native-izooto/src/PushTemplate';

componentDidMount() {
  iZooto.setDefaultTemplate(PushTemplate.TEXT_OVERLAY);
}

This would override the default behavior and would use the new Text Overlay template.

🚧

Points to Note

  • This method is available only for Native SDK v1.3.3+, Flutter plugin v2.0.0+ and React Native plugin v2.0.4+.
  • You can pass PushTemplate.DEFAULT in the method to default to the normal Android notification template.
  • Our latest SDKs (Native v1.4.5; Flutter v2.0.2; and React Native v2.0.6) now support the NewsRoom Template with Android 12 as well.

👍

Done! You're all set to use the new Android NewsRoom Template and woo your end-users.



Set Default Notification Banner Image

If you plan to use the Text Overlay custom template (as defined above), it is a good practice to define a default banner image to be used with the notification in case the actual banner image does not load due to network issues, etc. This would ensure that the notification is always pushed with a banner image.

In order to define the default banner image, you can use the below method in the main Application class:

iZooto.setDefaultNotificationBanner(R.drawable.Image_name);
iZooto.setDefaultNotificationBanner("image_name");
iZooto.setDefaultNotificationBanner("image_name");

🚧

Points to Note

  • The image should already be present in the project directory.
  • Supported file types are .jpg, .jpeg and .png.

Did this page help you?