[英]Launch an app with push notification after it has been terminated
I was wondering if there was a way to wake up an app that has been terminated by the user on ios8-9. 我想知道是否有办法唤醒用户在ios8-9上终止的应用程序。 By terminated I mean double click on the home button and swipe up.
终止后我的意思是双击主页按钮并向上滑动。
Is it somehow possible to launch an app by sending a silent push notification so that didreceiveremotenotification
gets fired and gives me some runtime ? 是否有可能通过发送静默推送通知来启动应用程序,以便
didreceiveremotenotification
触发了重新启动,并给了我一些运行时间?
I have noticed that a fair share of my users terminate my app. 我注意到我的用户公平分享了我的应用程序。 As I rely heavily on background fetch, this a problem.
由于我非常依赖后台提取,这是一个问题。 My idea was to send silent push notifications to launch the app in the background and trigger background fetch.
我的想法是发送静默推送通知以在后台启动应用程序并触发后台提取。
Short Answer: No That is not possible. 简答:不,这是不可能的。
Detail: 详情:
When there is any new content on server you will send Remote Notification to your application to inform about that. 当服务器上有任何新内容时,您将向您的应用程序发送远程通知以通知相关内容。 (A Remote Notification is really just a normal Push Notification with the
content-available
flag set) (远程通知实际上只是设置了
content-available
标志的普通推送通知)
When application received this Remote Notification it calls following method: 当应用程序收到此远程通知时,它会调用以下方法:
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
In Documentation of this method it is clearly written: 在这个方法的文档中,它写得很清楚:
However, the system does not automatically launch your app if the user has force-quit it.
但是,如果用户强行退出,系统不会自动启动您的应用。 In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.
在这种情况下,用户必须重新启动应用程序或重新启动设备,然后系统才会再次尝试自动启动应用程序。
Reference: 参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.