pusher / push-notifications-flutter

Official Pusher Beams Flutter client plugin (iOS, Android and Web), receive notifications easily on your Flutter application with Pusher Beams.
https://pub.dev/packages/pusher_beams
MIT License
10 stars 27 forks source link

setUserId got error 401 in Android, but worked in iOS #38

Closed YanaWijaya closed 1 year ago

YanaWijaya commented 1 year ago

I've got this error message when trying to setUserId() in Android image

It's strange because it works fine in iOS.

Response from the BE server: {"token":"eyJhbG......."}

This is how I use the setUserId: image image

benw-pusher commented 1 year ago

The 401 response would indicate the server did not authorize the incoming auth request. You might need to add some logging on the server to identify why this is the case - perhaps the cookie is not being set correctly? You also shouldn't need to append the userGuid to the authUrl, the library should automatically pass the userId specified when PusherBeams.instance.setUserId is invoked. The user ID is the first parameter for this method. Let us know if this helps.

benw-pusher commented 1 year ago

We haven't had a response here so I will close, if you need further assistance please get in touch at https://support.pusher.com/hc/en-us/requests/new