Customizing the Push Notification Handler in the BlackBerry Hybrid Web Container

The comment tag associated with this customization is BLACKBERRY_CUSTOMIZATION_POINT_PUSH_NOTIFICATION.

By default, when a push notification is received by the Hybrid Web Container push listener, it returns the PushNotificationListener.NOTIFICATION_CONTINUE method, which allows the next push listener to handle the notification.

The comments in the onPushNotification method in the CustomizationHelper.java file include sample code that demonstrates how to open the default client-initiated Hybrid App if no Hybrid App is currently opened and also, optionally, calls a JavaScript method to initialize the Hybrid App once it is opened.

  1. Open the CustomizationHelper.java file for editing.
  2. Find the onPushNotification method and make your changes.
    For example, if PushNotificationListener.CANCEL is returned, the push listener manager does not invoke the next push notification listener.
  3. Save the file.
  4. Rebuild the project.