Skip to content

Instantly share code, notes, and snippets.

@joshjensen
Created January 2, 2014 23:36
Show Gist options
  • 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