Skip to content

Instantly share code, notes, and snippets.

@boydlee
Created October 9, 2016 16:21
Show Gist options
  • Save boydlee/2e5bbcf6c8795fd821d9e231841a776d to your computer and use it in GitHub Desktop.
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
/*
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