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/00bbaea42964509b55b1 to your computer and use it in GitHub Desktop.

Select an option

Save CHLibrarian/00bbaea42964509b55b1 to your computer and use it in GitHub Desktop.
ContextHub Context Rule Push Background Gist
// Sending background pushes via different identifiers
var token = "71962e3cbc7dfa91e8bec21b532b69c211a55453a1407299bb78f931c7e8f7ec"
var deviceId = "BC903204-51C1-4DF6-92E8-F5A5DE00E26E"
var alias = "Jeff's iPhone 5"
var arrayOfTags = new Array()
arrayOfTags.push("device-tag")
var data = { "payload": {"age": "25", "height": "6.25"} }
var sound = ""
// Sending background push via token
push.sendBackgroundToToken(token, JSON.stringify(data), sound)
// Sending background push via device id
push.sendBackgroundToDeviceId(deviceId, JSON.stringify(data), sound)
// Sending background push via alias
push.sendBackgroundToAlias(alias, JSON.stringify(data), sound)
// Sending background push via tags
push.sendBackgroundToTags(arrayOfTags, JSON.stringify(data), sound)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment