简体   繁体   English

在后台时推送iOS通知

[英]Push Notifications for iOS while in the background

我的应用程序正在接收通知,而我的问题是,当我在后台收到一个或多个通知时,当我单击应用程序图标将我带到应用程序前台时,通知消息将无法显示在仅当我单击通知中心中的弹出消息而不是图标时,它才有效。

You will not get remote push notification data on launch of app after tapping icon. 点击图标后,您将无法在启动应用程序时获得远程推送通知数据。 You can only parse push notification body only on tap of notification alert. 您只能在点击通知警报时才能解析推送通知正文。 So if you want to do any MUST NEED operation for such notifications there is only way is to introduce server in between. 因此,如果您想对此类通知执行任何“必须”操作,则唯一的方法是在两者之间引入服务器。 So you can use any web service for it and this will be called every time your app launches or comes to foreground. 因此,您可以使用任何Web服务,并且每次您的应用启动或进入前台时都会调用该服务。 Call that API on background and do the needful you want. 在后台调用该API并执行您需要的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM