Created
October 9, 2016 16:21
-
-
Save boydlee/2e5bbcf6c8795fd821d9e231841a776d to your computer and use it in GitHub Desktop.
OneSignal library and basic example for push notifications using Appcelerator Titanium See https://gist.github.com/boydlee/fc6955cbd4a7ba1d302df2a4bc93bb06 for the ti.onesignal.js module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
OneSignal library and basic example for push notifications using Appcelerator Titanium | |
See https://gist.github.com/boydlee/fc6955cbd4a7ba1d302df2a4bc93bb06 for the ti.onesignal.js module | |
*/ | |
var OneSignal = require('ti.onesignal'); | |
OneSignal.register(function(response){ | |
console.log(response); | |
if(response.success && response.id != "") { | |
//response.id your OneSignal installation id | |
OneSignal.updateTags(response.id, {"fav_color": "yellow", "my_tag": "abc123"}); | |
} | |
}); | |
OneSignal.onPush = function(data) { | |
alert(JSON.stringify(data)); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment