Skip to content

Instantly share code, notes, and snippets.

@matzew
Last active December 18, 2015 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/569190db18694afe22f6 to your computer and use it in GitHub Desktop.
Save matzew/569190db18694afe22f6 to your computer and use it in GitHub Desktop.
Push Client Registration Spec/SDK

AeroGear UnifiedPush Registration Client Spec (DRAFT 0.0.3)

This document describes the functionality of a client SDK that works with the AeroGear UnifiedPush Server.

Motivation / Purpose

The AeroGear UnifiedPush Server is accessible via HTTP. Instead of having to manually register a device (MobileVariantInstance) with the HTTP interface, a client library should be offered.

Goal: A client library to register a mobile application (MobileVariantInstance) with the UnifiedPush Server.

Background: Push Network Token

To receive native push notifications from a Push Network (e.g. APNs, GCM or SimplePush), the mobile device is identified with a unique device-token, assigned by the actual Push Network. This device-token is passed, by the underlying Operating-System, to the mobile application. Details are different on each platform and not part of this document.

The device-token needs to be registered with the AeroGear UnifiedPush Server, to indicate there is a new MobileVariantInstance for a MobileVariant. More details about the server-side part of this can be found in the AeroGear Unified Push Server spec.

Functionality

WARNING: The focus of this specification is to describe the generic minimum and not any platform-specific requirements

The client SDK offers the following features:

  • Registration and Updating of a MobileVariantInstance
  • Unregistration of a Mobile Variant Instance (optional, due to platform specific restrictions)

Registration and Updating of a Mobile Variant Instance

Everytime when a mobile application launches it receives the above mentioned device-token, via a platform-specific method (or callback). Since the Push Network (e.g. APNs or GCM) may assign a new token to a device, it is recommended to always (re)register the device-token with the AeroGear UnifiedPush Server.

Besides the device-token the AeroGear UnifiedPush Server is able to store some of the below device- or user-specific metadata:

  • deviceToken: Identifies the device/user-agent within its Push Network.
  • deviceType: The device type of the device or the user agent.
  • mobileOperatingSystem: The name of the underlying Operating System.
  • osVersion: The version of the used Operating System.
  • alias: _ Application specific alias to identify users with the system. For instance an email address or a username._
  • category: Used tp apply a "tag". Mainly usful for the SimplePush channel(s).

Besides the slight chance that the ```device-token`` may change, some of the above metadata is more likely to change. Therefore another reason to always send this metadata to the AeroGear UnifiedPush Server.

Reachability

The client SDK needs to check if the device can establish a connection to the internet (PushNetwork and UnifiedPush Server). It should make use of the platform-specific APIs to check the reachablility of the services.

Unregistration of client device information

Optional method that helps to unregister the client device information with the AeroGear Unified Push Server. Note: _The method is optional, since not all supported Push Networks recommend having a client application actively performing an unregister. Apple for instance has a Feedback Service, which the AeroGear Unified Push Server needs to freequently query for inactive tokens. Tokens, with Apple, are inactive when the user:

  • Disables Push (Settings)
  • Deinstalls the app

Reachability

The client SDK needs to check if the device can establish a connection to the internet (PushNetwork and UnifiedPush Server). It should make use of the platform-specific APIs to check the reachablility of the services.

Auth/Security

To be discussed.....

Platform specific details

Every client platform has it's own base APIs, to receive Push Message from it's Push Network. The AeroGear client SDK may offer utilities to even more simplify this process. For example: In Android a custom Intent is required, therefore it would make sense if the "AeroGear Android Push Client Library" offers a convenience implementation for this class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment