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

前端 未结 2 1519
一生所求
一生所求 2021-02-03 15:59

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

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

2条回答
  •  执笔经年
    2021-02-03 16:19

    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.

提交回复
热议问题