I am attempting to connect to pusher chatkit; however, everytime I attempt the connection I am receiving this response:
"Making attempt 5 of 6 in 16.0s. Error was: Bad response status code received: 401 with error message: services/chatkit_authorizer/authorization/missing_permission: User does not have access to requested resource"
After it makes 6 attempts it then connects, so I am not sure what the missing permission is.
Below is the code I am using to connect.
self.chatManagerDelegate = MyChatManagerDelegate()
chatManager = ChatManager(instanceLocator: Pusher_Chatkit.instanceLocator,
tokenProvider: PCTokenProvider(url: Pusher_Chatkit.tokenProvider),
userID: "user-id")
chatManager.connect(delegate: chatManagerDelegate!) { currentUser, error in
guard error == nil else {
print("Error connecting: \(error!.localizedDescription)")
return
}
print("Successfully connected")