0

I am working on an app and trying to integrate LayerKit into it. After every 10 minutes, Layer has to be authenticated again as every nonce is valid for 10 minutes.
When I am trying to authenticate it, I get an error:
Cannot request authentication nonce because client is already authenticated as 123456 (123456 is userID).

But when I send any message, the status just stuck to "Pending". I can't send or receive any message. I have to close my app and open again to resume communication.

I am using Swift 2.2 and is not using Parse. I am using my API to acquire identity Token from Layer. But I can't reauthenticate Layer. Everytime it is showing the same error.

I have also Reset Network Settings from my iPhone, still no luck. Any help would be appreciated.

D4ttatraya
  • 3,344
  • 1
  • 28
  • 50
Rahul Garg
  • 153
  • 1
  • 1
  • 12

1 Answers1

-1

I had the same issue.

You just need to deauthenticate before request authentication nonce:

- (void)deauthenticateWithCompletion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion;
arghtype
  • 4,376
  • 11
  • 45
  • 60
Amos Hsueh
  • 211
  • 4
  • 11