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

More verbose error message #201

Open
Real-Gecko opened this issue Mar 3, 2022 · 5 comments
Open

More verbose error message #201

Real-Gecko opened this issue Mar 3, 2022 · 5 comments

Comments

@Real-Gecko
Copy link

I had a misconfigured APNS on FCM and was receiving InvalidArgumentError('Request contains an invalid argument.') from fcm-django while trying to send message to iOS, which was totally unclear to me. By using debugger I was able to find that exact response from FCM is

{
    "error": {
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
                "errorCode": "INVALID_ARGUMENT"
            },
            {
                "@type": "type.googleapis.com/google.firebase.fcm.v1.ApnsError",
                "statusCode": 400,
                "reason": "DeviceTokenNotForTopic"
            }
        ]
    }
}

Which showed that problem is in APNS actually with certain error reason. Is it possible to get more verbose error output without using debugger?

@eliezerp3
Copy link

Did u ever get post v1 fcm-django to work for iOS?

@Real-Gecko
Copy link
Author

Yes it's working now, there was some kind of configuration issue in Firebase related to APNS certificates and developer key, which I'm not aware of cause Firebase setup and iOS development is done by other people. However this reason DeviceTokenNotForTopic was a key to solving this, and INVALID_ARGUMENT was not clear to anyone. That's why I created this issue.

@Real-Gecko
Copy link
Author

By the way, to actually get notification on iOS(actual popup) you need to send notification like this:

    message = Message(data=data, notification=Notification(title=title, body=body))

As Android developers said to me it's it's only sufficient to have data with title and body keys, but for iOS you need actual Notification instance added to the message.

@xtrinch
Copy link
Owner

xtrinch commented Mar 22, 2022

@Real-Gecko Did the error messages not write itself onto the devices, visible in the admin panel?

@Real-Gecko
Copy link
Author

Did not check that, because I don't use admin. But only message I got is mentioned in op.

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