Has*_*sya 3 push-notification apple-push-notifications ios appdelegate pushkit
app的生命周期是什么?当app处于终止状态并且推送套件有效负载到来时.
首先,Pushkit委托方法将起作用或AppDelegate方法将起作用.
有人可以描述在这种情况下被调用的方法序列吗?
感谢你的回答.
提前致谢.
推送套件有效负载到达iOS设备后.整个iOS应用程序在后台变为活动状态(请注意 - 应用程序不会调用或进入前台),只有应用程序将在后台运行.
首先
didFinishLaunchingWithOptions // will invoke
Run Code Online (Sandbox Code Playgroud)
然后
didReceiveIncomingPushWithPayload // payload method gets invoke
Run Code Online (Sandbox Code Playgroud)
然后,如果你有本地通知
didReceiveLocalNotification // receive local notification
Run Code Online (Sandbox Code Playgroud)
然后
handleActionWithIdentifier // handler method if you have action buttons ( local )
Run Code Online (Sandbox Code Playgroud)
然后,如果你有远程通知
didReceiveRemoteNotification // receive remote notification
Run Code Online (Sandbox Code Playgroud)
然后
handleActionWithIdentifier // handler method if you have action buttons ( remote )
Run Code Online (Sandbox Code Playgroud)
当静默推送通知到来并且相应地工作时,Pushkit在VOIP相关应用中最有用.
当特定通知到来时,大部分需要删除1个特定通知.使用pushkit我们可以安排本地通知,在获取另一个推送工具包通知时,我们可以删除第一个本地通知而无需最终用户交互 否则app将无法在没有用户交互的情况下删除通知.
谢谢@Hitesh.