function deviceTokenSuccess(e) {
    deviceToken = e.deviceToken;
    Ti.API.info('Token: '+e.deviceToken);
    
     Cloud.PushNotifications.subscribeToken({
	        device_token: e.deviceToken,
	        channel: 'Pizzaiola',
	        type: Ti.Platform.name == 'android' ? 'android' : 'ios'
	    }, function (e) {
	        if (e.success) 
	            Ti.API.info('Subscribed');
	         else 
	            Ti.API.error('Error:\n' + ((e.error && e.message) || JSON.stringify(e))); 
	    });
}
// Save the device token for subsequent API calls
Save the device token for subsequent API calls
Save the device token for subsequent API calls
function deviceTokenSuccess(e) {
    deviceToken = e.deviceToken;
    Ti.API.info('Token: '+e.deviceToken);
     Cloud.PushNotifications.subscribeToken({
	        device_token: e.deviceToken,
	        channel: 'Pizzaiola',
	        type: Ti.Platform.name == 'android' ? 'android' : 'ios'
	    }, function (e) {
	        if (e.success) 
	            Ti.API.info('Subscribed');
	         else 
	            Ti.API.error('Error:\n' + ((e.error && e.message) || JSON.stringify(e))); 
	    });
}
function deviceTokenSuccess ( e ) { deviceToken = e . deviceToken ; Ti . API . info ( 'Token: ' + e . deviceToken ) ; Cloud . PushNotifications . subscribeToken ( { device_token : e . deviceToken , channel : 'Pizzaiola' , type : Ti . Platform . name == 'android' ? 'android' : 'ios' } , function ( e ) { if ( e . success ) Ti . API . info ( 'Subscribed' ) ; else Ti . API . error ( 'Error:\n' + ( ( e . error && e . message ) || JSON . stringify ( e ) ) ) ; } ) ; }
Save the device token for subsequent API calls
Save the device token for subsequent API calls