Life cycle of app - when app is in terminated and push kit payload comes

空扰寡人 提交于 2019-11-30 05:31:33

Life cycle of app - when app is in terminated and push kit payload comes

  • When you receive a push payload then application became active for 20-30 second in terminate state then call following method.

  • didFinishLaunchingWithOptions(Here perform some intilization operation intiliaze window and rootviewcontroller and execute other code.)

  • didReceiveIncomingPushWithPayload

  • In this 20-30 second application became active and also you can get a active state of application in the didReceiveIncomingPushWithPayload

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.

First of all

didFinishLaunchingWithOptions // will invoke

then

didReceiveIncomingPushWithPayload // payload method gets invoke

then if you have local notification

didReceiveLocalNotification  // receive local notification

then

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

then if you have remote notification

didReceiveRemoteNotification // receive remote notification

then

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

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

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.

Thanks @Hitesh.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!