Skip to content

Instantly share code, notes, and snippets.

@CHLibrarian
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save CHLibrarian/f5aab36ce20d86828099 to your computer and use it in GitHub Desktop.

Select an option

Save CHLibrarian/f5aab36ce20d86828099 to your computer and use it in GitHub Desktop.
ContextHub Context Rule Push Gist
// Sending simple notification to all devices with the 'active' tag
push.deliver( JSON.stringify({tags: ["active"], alert: "Hello World."}));
// Sending a silent background notification
var data = { "commuter": "group_location_refresh" };
var devices = [ "5048A9B5-2089-4AD6-AAE4-25E7837385AC", "2e074d0b18b7b190" ]
var payload = { "device_ids" : devices, "priority" : 10, "sound" : "", "content_available" : 1, "data" : data };
push.deliver(JSON.stringify(payload));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment