Skip to content

Instantly share code, notes, and snippets.

@sharpred
Last active August 29, 2015 13:56
Show Gist options
  • Save sharpred/9004271 to your computer and use it in GitHub Desktop.
Save sharpred/9004271 to your computer and use it in GitHub Desktop.
Push Notification. This is a sample push notification payload file that Creator will send to registered devices
{
"title": "External Link Example (Get)",
"alert": "Sample Alert",
"icon": "little_star",
"badge": "+1",
"sound": "circus.wav",
"vibrate": false,
"callToAction": {
"action": "B",
"uri": "http: //www.example.com",
"type": "GET"
},
"urgent": "true",
"homeScreenMessage": "true"
},
{
"title": "External Link Example (Post)",
"alert": "Sample Alert",
"icon": "little_star",
"badge": "+1",
"sound": "circus.wav",
"vibrate": false,
"callToAction": {
"action": "B",
"uri": "http: //www.example.com",
"type" : "POST",
"form" : [{}] //an array of key/value pair objects to pre-populate an HTTP post form
},
"urgent": "true",
"homeScreenMessage": "true"
},
{
"title": "In App Example Flights",
"alert": "Sample Alert",
"icon": "little_star",
"badge": "+1",
"sound": "circus.wav",
"vibrate": false,
"callToAction": {
"action": "P",
"uri": "flights",
"link": {"flightNumber":"BA176"}
},
"urgent": "true",
"homeScreenMessage": "true"
},
{
"title": "In App Example Excursions",
"alert": "Sample Alert",
"icon": "little_star",
"badge": "+1",
"sound": "circus.wav",
"vibrate": false,
"callToAction": {
"action": "P",
"uri": "excursion",
"link": {"code":"1008991350"}
},
"urgent": "false",
"homeScreenMessage": "false"
},
{
"title": "In App Example Currency",
"alert": "Sample Alert",
"icon": "little_star",
"badge": "+1",
"sound": "circus.wav",
"vibrate": false,
"callToAction": {
"action": "P",
"uri": "foreignCurrency",
"link": {"type":"travelmoney"}
},
"urgent": "false",
"homeScreenMessage": "false"
}
@sharpred
Copy link
Author

  • icon, badge, sound, vibrate are all optional values
  • sound and icon must correspond to file assets contained in the device. Assumption for this release is that these will NOT be provided
  • display will be one of (or a combination of) CI (Customer Inbox), HSM (Home Screen Messages), HSB (Home Screen Biscuit) listed in an array field and is mandatory
  • action will be either B (Browser) or P (In App Page) and is a mandatory value
  • uri will be the resource to load, either an external URL or an app page.
  • if the action is "B", the uri must be a website link (we will regex check this)
  • if the action is "P", the url must be one of the following list;
    "customerInBox", "home", "holidaySummary", "holidayCountdown", "holidayChecklist", "weather", "flights", "hotel", "destination", "excursions", "gettingToAirport", "extras", "travelMoney", "importantInformation", "contactUs"
  • urgent messages are flagged as true unless property is set to false or the property is absent, so is a non mandatory field

@sharpred
Copy link
Author

renamed entrypoint and endpoint to action and display respectively, to (hopefully) make their usage more human readable/ obvious :-)

@sharpred
Copy link
Author

This structure will need to change to accomodate deep linked pages, so should not be considered final.

@fzuppa-zz
Copy link

Hi Paul,
Looking at the documentation again, I see that messages will always be shown in the 'Customer Inbox' (CI) and Home Screen Biscuit (HSB) so the only optional place is the Home Screen Message (HSM). If this is the case, we could remove the display array and replace it just with an extra boolean field which indicates if the message should be shown in the HSM (this should make the implementation simpler). If we remove the display array, probably we could rename "inbox" to "cta" or "call_to_action". The resulting json will be like this:

{
"title": "Inbox Example",
"alert": "Sample Alert",
"icon": "little_star",
"badge": "+1",
"sound": "circus.wav",
"vibrate": false,
"call_to_action": {
"action": "B",
"uri": "http: //www.example.com"
},
"urgent": "true",
"home_screen_message":"true"
}

What do you think?

@sharpred
Copy link
Author

sharpred commented Mar 7, 2014

I have updated this to reflect Fede's comments and given sample deep links

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