Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result does not return success or failed #347

Open
ak84513 opened this issue Jul 1, 2024 · 3 comments
Open

Result does not return success or failed #347

ak84513 opened this issue Jul 1, 2024 · 3 comments

Comments

@ak84513
Copy link

ak84513 commented Jul 1, 2024

it is returning {'name': 'projects/xxxxx/messages/0:xxxxxxxxxxxxxx'}

@jinwoojimmy
Copy link

@ak84513 So I am checking the success by checking if 'name' key exists in the dict 😆

@jarzac
Copy link

jarzac commented Aug 28, 2024

Thanks for the insight @jinwoojimmy.

My application relies on knowing if sending a message was successful or not.

Does this mean that if there is a 'name' key, it was successful? And what is the path? How can the response be retrieved?

@jarzac
Copy link

jarzac commented Sep 3, 2024

Yes, it appears that it'll return 'name' if it was successful.

If it's a failure, it will respond with an error code 404, and the response will look different. This is an example for when the device token is incorrect:

 {
     "error": {
        "code": 404,
        "message": "Requested entity was not found.",
        "status": "NOT_FOUND",
        "details": [
            {
                 "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
                 "errorCode": "UNREGISTERED"
             }
         ]
     }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants