Hi,
I Cant able to trigger trayClickFocusedApp and trayClickLaunchedApp in acs android.
only call back event is firing while receiving push, here is my code for reference, please help me to get this solved.
var CloudPush = require('ti.cloudpush'); CloudPush.singleCallback = true; //CloudPush.enabled = true; CloudPush.debug = true; CloudPush.showTrayNotification = true; CloudPush.showAppOnTrayClick = true; CloudPush.showTrayNotificationsWhenFocused=true;
function subscribe(dev){ Cloud.PushNotifications.subscribe({ channel: 'demo_alert', device_token: dev, type: 'gcm' }, function (e){ if (e.success) {
Ti.API.info('Subscribed for Push Notification!');
CloudPush.addEventListener('callback', function (e)
{
Titanium.Media.vibrate();
var arr_from_json = JSON.parse(e.payload);
var toast = Ti.UI.createNotification({
message:arr_from_json['android'].alert,
duration: Ti.UI.NOTIFICATION_DURATION_LONG
});
toast.show();
var ItemDetailWindow = require('/ui/common/ItemDetailWindow');
new ItemDetailWindow(arr_from_json.ProjID, arr_from_json.SellerID, '','').open();
});
CloudPush.addEventListener('trayClickLaunchedApp', function(evt) { alert(1); }); CloudPush.addEventListener('trayClickFocusedApp', function(evt) { alert(2); });
}else{
Ti.API.info('Error:' +((e.error && e.message) || JSON.stringify(e)));
}
}); }