Skip to content

Instantly share code, notes, and snippets.

@mahlon-gumbs
Created September 8, 2012 13:04
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 mahlon-gumbs/3674747 to your computer and use it in GitHub Desktop.
Save mahlon-gumbs/3674747 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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