'How to distinguish uninstalled apps as a result of sending from Firebase Cloud Messaging (FCM)?

In my app, the FCM token is sent to the server immediately after issuance. The server receives the client FCM token, stores it, and sends a message to the FCM token for the client when needed.

However, on iOS devices, even if the client uninstalled the app, the result of sending on the server is showed as a success. (For Android devices, failure(NotRegistered) is received. this is the ideal result.)

{
    "multicast_id":****************,
    "success":1,
    "failure":0,
    "canonical_ids":0,
    "results":[
        {
            "message_id":"0:**********************"
        }
    ]
}

Can you explain why the result on the sever showed that the sending FCM tokens was succeded even when the client uninstalled the apps?

As showed on the following document, it says "failure" with the result "NotRegiestered". Is this only for Android? So, how can I get these results on iOS?

https://firebase.google.com/docs/cloud-messaging/concept-options#lifetime

Finally, when FCM attempts to deliver a message to the device and the app was uninstalled, FCM discards that message right away and invalidates the registration token. Future attempts to send a message to that device results in a NotRegistered error.

Can you tell me how to get the result as "failure" like in Android when sending the token to client who uninstalled the apps?

To classify the client that uninstalled the app, i should get the result of failure(NotRegistered) like Android.

[The same issues]



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source