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

FirebaseMessagingAdminException: messaging/invalidargument: One or more arguments specified in the request were invalid. #31

Open
scalz opened this issue Apr 9, 2024 · 0 comments

Comments

@scalz
Copy link

scalz commented Apr 9, 2024

Hello,

thank you for this package, this is nice to have it for Dart :)

When testing sending message to iOS, I get this error:
FirebaseMessagingAdminException: messaging/invalidargument: One or more arguments specified in the request were invalid.

This is because critical, availableContent and mutableContent are bool properties, but they are also sent as bool to FCM.
Per Apple documentation, these should be sent as int 0/1.
https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification

After fixing related _toProto() methods, issue is gone.
I simply fixed it like this:
fix adminsdk

I can eventually make a PR for these changes. But before that, I would like to be sure:

  • regarding type promotion, do you prefer that I create a local var then test it. Or the Non-null assertion operator is ok ?
  • are you ok if, like in my screenshot, I remove null values so they are not sent to FCM. I think I noticed in Typescript AdminSdk it does not send them. If so do you prefer two separated PR, one for the bool fix, and another one for "skimmed" null values ?
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

1 participant