如何处理Push on App未运行状态? [英] How to handle Push on App not running state?

查看:259
本文介绍了如何处理Push on App未运行状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以根据推送通知内容打开iOS App?我相信这是不可能的。还有其他方法吗?我相信我们可以使用iOS10中的小部件,对吧?请建议一些好的解决方案?

Is it possible to open the iOS App based on push notification content? I believe it's not possible. Is there any other way around? I believe we can go with the widget in iOS10, right? Please suggest some good solution?

谢谢!

推荐答案

每当你的有效负载有内容可用:1 您的应用程序将在它到达时立即在后台状态中调用,并将调用 application(_:didReceiveRemoteNotification:fetchCompletionHandler:) 。如果用户手动终止应用程序,则不会调用它。 (这不会启动你的应用程序。它需要你的应用程序才能启动)

Whenever your payload has content-available:1 your app will get called in the backgroundstate as soon as it arrives and will call application(_:didReceiveRemoteNotification:fetchCompletionHandler:). It will only not get called if the user killed the app manually. (This doesn't launch your app. It requires your app to be launched though)

如果您的应用程序被终止(由用户)但用户点击了然后通过didFinishLaunching ...委托方法将您的应用启动

Having that said if your app was terminated (by user) but the user taps on the notitication then your app is launched from didFinishLaunching...delegate method.

这篇关于如何处理Push on App未运行状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆