Skip to content

Instantly share code, notes, and snippets.

@joshjensen
Created January 2, 2014 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshjensen/8229433 to your computer and use it in GitHub Desktop.
Save joshjensen/8229433 to your computer and use it in GitHub Desktop.
function deviceTokenSuccess(e) {
Ti.API.info('Device Token: ' + e.deviceToken);
deviceTokenLabel.text = 'Device Token:' + e.deviceToken;
enablePush.enabled = true;
var Cloud = require("ti.cloud");
Cloud.PushNotifications.subscribeToken({
device_token: APP.Push.deviceToken,
channel: "test,
type: Ti.Platform.name === 'android' ? 'android' : 'ios'
}, function(e) {
if(e.success) {
alert("Success");
} else {
alert("Fail")
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment