Programming Push Notifications

To implement push notifications for an eFTL application, complete these steps in your mobile application code.

Prerequisites

  • Your application runs on a mobile platform that supports push notification.
  • Your application already has an ID and authentication with the platform vendor's push notification service (PNS).

Procedure

  1. Code a notification callback.
    Conform to the requirements of the vendor's push notification service.
  2. Request a notification token from the PNS.
    The token uniquely represents your application running on a specific mobile device. The token also represents your application within the device's operating system.
  3. Supply the notification token as a property in the eFTL client connect call.
  4. Create eFTL sbuscriptions as usual.
  5. Disconnect from the server when the application exits or transitions to a background state.
    While the client is disconnected, the server maintains the client's eFTL subscriptions, and sends a push notification whenever an eFTL message arrives.
  6. Reconnect to the server when the application transitions to a foreground state.
    The server automatically delivers any eFTL messages that are waiting for the client.