仅在 IOS 内当 App 在前台时获取 Appcelerator Titanium 推送通知
Get Appcelerator Titanium push notification while App in foreground in IOS only
我已经在我的应用程序(Android 和 IOS)中为消息接收实现了 Appcelerator Titanium 推送通知:
我在 android 中收到关于应用程序处于后台和前台的通知。我在 android 中使用下面的 属性 来在应用程序处于前台时显示通知 (CloudPush.showTrayNotificationsWhenFocused = true;)
问题: 我在 IOS(版本 9.1 iPhone5)中遇到问题,当应用程序处于前台时接收通知。
当应用程序在后台时,通知会显示在通知栏中,但当应用程序在前台时,通知不会显示在 IOS.
的通知栏中
任何人都可以帮助我吗,当应用程序在 IOS.
的前台时,我如何收到通知
谢谢
查看推送通知的 Documentation。
在文档里面有一个回调:
Ti.Network.registerForPushNotifications({
success: deviceTokenSuccess,
error: deviceTokenError,
callback: receivePush
});
这 link 到此代码:
// Process incoming push notifications
function receivePush(e) {
alert('Received push: ' + JSON.stringify(e));
}
这也会在应用内触发。
请按照上面的link正确设置。否则可能无法正常工作。
我已经在我的应用程序(Android 和 IOS)中为消息接收实现了 Appcelerator Titanium 推送通知:
我在 android 中收到关于应用程序处于后台和前台的通知。我在 android 中使用下面的 属性 来在应用程序处于前台时显示通知 (CloudPush.showTrayNotificationsWhenFocused = true;)
问题: 我在 IOS(版本 9.1 iPhone5)中遇到问题,当应用程序处于前台时接收通知。 当应用程序在后台时,通知会显示在通知栏中,但当应用程序在前台时,通知不会显示在 IOS.
的通知栏中任何人都可以帮助我吗,当应用程序在 IOS.
的前台时,我如何收到通知谢谢
查看推送通知的 Documentation。
在文档里面有一个回调:
Ti.Network.registerForPushNotifications({
success: deviceTokenSuccess,
error: deviceTokenError,
callback: receivePush
});
这 link 到此代码:
// Process incoming push notifications
function receivePush(e) {
alert('Received push: ' + JSON.stringify(e));
}
这也会在应用内触发。
请按照上面的link正确设置。否则可能无法正常工作。