Firebase silent notification does not start up a closed iOS app

前端 未结 1 1462
慢半拍i
慢半拍i 2021-01-05 02:46

Can FCM silent notification start up a closed iOS app?

Request Type: POST

Request URL: https://fcm.googleapis.com/fcm/send

Request Headers:

Authorization          


        
相关标签:
1条回答
  • 2021-01-05 03:30

    It's the expected behavior to not launch the app. I mean why should it? The user for some reason has decided to kill the app. They don't want battery or bandwidth getting used for it anymore!

    From documentation.

    Use this method to process incoming remote notifications for your app. Unlike the application(_:didReceiveRemoteNotification:) method, which is called only when your app is running in the foreground, the system calls this method when your app is running in the foreground or background. In addition, if you enabled the remote notifications background mode, the system launches your app (or wakes it from the suspended state) and puts it in the background state when a remote notification arrives. However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again


    For non-silent notifications. They would get delivered to the device. But not to the app.

    If you force-quite your Whatsapp on your iPhone and your mother sends you a message, then your iPhone would show it among its notifications. However it won't trigger any of your AppDelegate methods. AppDelegate methods are only triggered if the app is not user terminated.

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