Azure-Samples / communication-services-ios-quickstarts

Sample code for Azure Communication Services iOS quickstarts
MIT License
11 stars 24 forks source link

chatclient startPushNotifications "Service returned invalid status code" #52

Open Calfredop opened 1 year ago

Calfredop commented 1 year ago

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

I'm working on a React Native app that needs to implemet Azure Communication Chat. I've made a Swift native module that should take care of enabling push notification via chatclient. Therefore I've followed the instructions to integrate the iOS sdk on the native part of my app.

What is working:

What is not working:

When I call the chatclient.startPushNotifications method, passig of course the correct deviceToken, I get an error and the push notifications don't get enabled.

Any log messages given by the failure

This is the error throwed by the library

error: client("Failed to start push notifications", Optional(AzureCore.AzureError.client("Failed to start push notifications", Optional(AzureCore.AzureError.client("Registration request failed.", Optional(AzureCore.AzureError.client("Registration request failed.", Optional(AzureCore.AzureError.service("Service returned invalid status code [400]", nil)))))))))]}

Expected/desired behavior

Since the deviceToken is generated correctly and sucesfuly used for other remote push notifications services, it should register just fine for Azure Chat.

OS and Version?

The error is occourring on iOS 13 running on an emulator.

Versions

AzureCommunicationChat iOS SDK 1.3.1