Time for action – registering a device for push notifications
You will be pleased to know that you have done almost all of the work for this already.
Grab the
urbanairship.js
code from https://gist.github.com/4438938 and put it into your app code base.Grab your development application key and secret from the app registration. Remember to change these keys prior to going live!
Modify the
registerForPushNotifications
call inapp.js
, adding in the highlighted code which calls the Urban Airship registration code:Ti.Network.registerForPushNotifications({ types: [ Ti.Network.NOTIFICATION_TYPE_BADGE, Ti.Network.NOTIFICATION_TYPE_ALERT, Ti.Network.NOTIFICATION_TYPE_SOUND ], success:function(e){ var UrbanAirship = require('urbanairship'); UrbanAirship.register({token : e.deviceToken, key : /* YOUR APPLICATION KEY */, secret : /* YOUR APPLICATION SECRET */, success : function(e) {alert...