Apple Push Notification setting up Remote Notifications method overrides other methods

前端 未结 1 1153
囚心锁ツ
囚心锁ツ 2021-01-23 15:42

I have properly set up my app for Remote Notifications with the method

func application(application: UIApplication, didReceiveRemoteNotification user

1条回答
  •  鱼传尺愫
    2021-01-23 16:20

    Apple does not allow what you want. Push notifications work in the following way

    1) When the application is not running, and the user clicks a notification, the application is launched and the payload of the notification is loaded in the function didFinishLaunchingWithOptions.

    2) When the application is running in background, and the user clicks a notification, the application becomes active and the function didReceiveRemoteNotification is called. Now this function contains the payload of the notification.

    3) When the application is running and a push notification is called, the function didReceiveRemoteNotification is called and this function contains the payload of the notification.

    4) When the app is running in background or inactive and notification is received, nothing can be done with the notifications until the user clicks the notification

    0 讨论(0)
提交回复
热议问题