bytefish / FcmSharp

Firebase Cloud Messaging (FCM) with .NET
MIT License
6 stars 7 forks source link

Invalid JSON payload received. Unknown name "aps" at 'message.apns': Cannot find field. #12

Closed smikaello closed 6 years ago

smikaello commented 6 years ago

If I add the Aps instanse into ApnsConfig in the message, I receive this error (error text is taken from FcmMessageException.Errors). No metter what content is inside the Aps, it fails every time. Please take a look.

bytefish commented 6 years ago

That's clearly a bug. I will fix it.

bytefish commented 6 years ago

@smikaello I have released Version 2.2.0 to NuGet. Please let me know, if it fixes the problem.

bytefish commented 6 years ago

I actually misread the structure and accidentally forgot the payload field in the ApnsConfig. The aps field is a child object of the payload and not of the ApnsConfig itself. That's why the error was thrown. Better Unit Testing should catch it, but I don't have the test data yet. Feel free to add a test, if your integration test was successful.

bytefish commented 6 years ago

Please reopen the issue, if the error still occurs.

smikaello commented 6 years ago

Thanks for the quick reply and fix, it works now.

bytefish commented 6 years ago

Great! Thanks for the feedback. 😎