应用在前台 iOS 时获取推送通知 - Get push notification while App in foreground iOS

10/14 04:54
阅读数 0

问题:

I am using push notification service in my app.我在我的应用程序中使用推送通知服务。 When app is in background I am able to see notification on notification screen(screen shown when we swipe down from top of iOS device).当应用程序在后台时,我可以在通知屏幕上看到通知(当我们从 iOS 设备顶部向下滑动时显示的屏幕)。 But if application is in foreground the delegate method但是如果应用程序在前台,则委托方法

- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo

is getting called but notification is not displayed in notification screen.正在被调用,但通知屏幕中未显示通知。

I want to show notification on notification screen independent of whether app is in background or foreground.我想在通知屏幕上显示通知,而不管应用程序是在后台还是前台。 I am tired by searching for a solution.我厌倦了寻找解决方案。 Any help is greatly appreciated.任何帮助是极大的赞赏。


解决方案:

参考一: https://en.stackoom.com/question/10OuO
参考二: https://stackoom.com/question/10OuO
展开阅读全文
ios
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部