应用程序的生命周期 - 当应用程序终止并且推送套件有效负载到来时 [英] Life cycle of app - when app is in terminated and push kit payload comes

查看:150
本文介绍了应用程序的生命周期 - 当应用程序终止并且推送套件有效负载到来时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

app的生命周期是什么?当应用程序处于终止状态并且推送套件有效负载到来时。

What would be life cycle of app? when app is in terminated state and push kit payload comes.

首先,Pushkit委托方法将起作用,或者AppDelegate方法将起作用。

First of all Pushkit delegate methods will work or AppDelegate methods will work.

有人可以描述在这种情况下被调用的方法序列吗?

Can someone describe sequence of methods getting called in such scenario?

感谢你的答案。

提前致谢。

推荐答案

推送套件有效负载到达iOS设备后。整个iOS应用程序在后台变为活动状态(记下 - 应用程序不会调用或进入前台),只有应用程序将在后台激活。

Once push kit payload reaches to iOS device. Whole iOS app becomes active in background ( Take a note - Application would not invoke or come in foreground ) , just app will become active in background.

首先

didFinishLaunchingWithOptions // will invoke

然后

didReceiveIncomingPushWithPayload // payload method gets invoke

然后如果你有本地通知

didReceiveLocalNotification  // receive local notification

然后

handleActionWithIdentifier // handler method if you have action buttons ( local )

然后如果您有远程通知

didReceiveRemoteNotification // receive remote notification

然后

handleActionWithIdentifier // handler method if you have action buttons ( remote ) 

当静默推送通知到来并且相应地工作时,Pushkit在VOIP相关应用中最有用。

Pushkit mostly beneficial in VOIP related apps, when silent push notification comes and work accordingly.

当特定通知到来时,主要需要删除1个特定通知。使用pushkit我们可以安排本地通知,在获得另一个推送工具包通知时,我们可以删除第一个本地通知而无需最终用户交互否则应用程序将无法在没有用户交互的情况下删除通知。

When mostly required to remove 1 particular notification when particular notification comes. using pushkit we can schedule local notifications and while getting another push kit notification we can remove 1st local notification without end users interaction. otherwise app would not be able to remove notification without user's interaction.

谢谢@Hitesh。

这篇关于应用程序的生命周期 - 当应用程序终止并且推送套件有效负载到来时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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