Customizing the Push Notification Handler in the iOS Hybrid Web Container

Customize the way the Hybrid Web Container handles push notifications.

By default, when a push notification is received by the Hybrid Web Container push listener, the kNotificationContinue method is returned, which allows the next push listener to handle the notification. The comments in the onPushNotification method in the HWCAppDelegate.m file includes some sample code that demonstrates how to open the default client-initiated Hybrid App if no Hybrid App is currently opened.

The comment tag associated with this customization is IOS_CUSTOMIZATION_POINT_PUSH_NOTIFICATION.

  1. Open the HWCAppDelegate.m file for editing.
  2. Find the onPushNotification method and make your changes.
    For example, if kNotificationCancel is returned, the push listener manager does not invoke the next push notification listener.
  3. Save the file.
  4. Rebuild the HWC.xcodeproj project.
    1. From the Xcode menu, select Product > Clean.
    2. Select Product > Build.