[英]Get Appcelerator Titanium push notification while App in foreground in IOS only
我已经在我的应用程序(Android和IOS)中为消息接收实现了Appcelerator Titanium推送通知:
当应用程序在后台和前台时,我都在android上收到通知。 我正在使用android中的below属性在应用程序处于前台时显示通知(CloudPush.showTrayNotificationsWhenFocused = true;)
问题:当应用程序处于前台时,收到通知时,我在IOS(版本9.1 iPhone5)中遇到问题。 当应用程序在后台时,通知显示在通知栏中,但是当应用程序在前台时,通知未显示在IOS的通知栏中。
请任何人能帮助我,当应用程序在IOS处于前台时如何获得通知。
谢谢
查看有关推送通知的文档 。
在文档内部有一个回调:
Ti.Network.registerForPushNotifications({
success: deviceTokenSuccess,
error: deviceTokenError,
callback: receivePush
});
链接到以下代码:
// Process incoming push notifications
function receivePush(e) {
alert('Received push: ' + JSON.stringify(e));
}
进入应用程序时也会触发。
请按照上面的链接进行正确设置。 否则可能无法正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.