Hello Community, I Implemented apple push notification in my ios application and want to show some message which is coming from server in push payload, i am receiving push notification but callback function never fired.
Below is the code which i am using callback never fired.
Titanium.Network.registerForPushNotifications({
types: [
Titanium.Network.NOTIFICATION_TYPE_BADGE,
Titanium.Network.NOTIFICATION_TYPE_ALERT,
Titanium.Network.NOTIFICATION_TYPE_SOUND
],
success:function(e){
var deviceToken = e.deviceToken;
Titanium.App.Properties.setString("deviceToken", deviceToken);
Ti.API.info("Push notification device token is: "+deviceToken);
//alert('device token is' +e.deviceToken);
},
error:function(e){
alert("Error during registration: "+e.error);
Ti.API.info("Error during registration: "+e.error);
},
callback:function(e)
{
// called when a push notification is received.
// alert("push received");
var my_alert=Ti.UI.createAlertDialog({title:'',message:JSON.stringify(e.data)});
my_alert.show();
}
});
Please help me. Thanks a lot in advance.