Hi all, I'm using registerForPushNotifications for registering iphone push notification. Basically, it works very well.
However, my issue is, I cannot understand why if I add any additional lines such as Ti.API.info('any thing here'); then all codes under callback will not work.
Below is my code that work with callback only show an alert box. Does any one know how to add more code into callback part?
Titanium.Network.registerForPushNotifications({
types: [
Titanium.Network.NOTIFICATION_TYPE_BADGE,
Titanium.Network.NOTIFICATION_TYPE_ALERT,
Titanium.Network.NOTIFICATION_TYPE_SOUND
],
success:function(e)
{
//**
},
error:function(e)
{
//**
},
callback:function(e)
{
var msg ='';
if (e.data && e.data.alert)
msg = e.data.alert;
if (e.data.alert.body) msg = e.data.alert.body;
var a = Ti.UI.createAlertDialog({
title:'',
message:msg,
});
a.show();
}
});