Create a gist now

Instantly share code, notes, and snippets.

ACS Push Notification
Cloud.Users.login({
login : 'default',
password : 'default'
}, function(e) {
if (e.success) {
var user = e.users[0];
alert('Success:\\n' + 'id: ' + user.id + '\\n' + 'first name: ' + user.first_name + '\\n' + 'last name: ' + user.last_name);
// Now that you've logged in, register for PNS
var myPushDeviceToken
Ti.Network.registerForPushNotifications({
type : [Ti.Network.NOTIFICATION_TYPE_ALERT, Ti.Network.NOTIFICATION_TYPE_BADGE, Ti.Network.NOTIFICATION_TYPE_SOUND],
success : myPushDeviceToken
});
} else {
alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
@mahlon-gumbs
Owner

This is a fragment used to assist someone in the Atlanta Titanium User Group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment