At the moment, the auth callbacks (JwtCallback and TokenRequestCallback) always require returning a value. This is fine when generating the token was successful. However, when the token generation failed, there is no clear way to communicate this to the AAT SDK.
On Android, this is done by throwing an exception from the auth callback. We should investigate how it should be done on iOS.
Additionally, users should have a way to tell the underlying Ably SDK to stop retrying the automatic reconnection. In AAT Android this is done by throwing a special exception or an exception that contains status code 403. For further details look at the Android issue and PR.
At the moment, the auth callbacks (JwtCallback and TokenRequestCallback) always require returning a value. This is fine when generating the token was successful. However, when the token generation failed, there is no clear way to communicate this to the AAT SDK.
On Android, this is done by throwing an exception from the auth callback. We should investigate how it should be done on iOS. Additionally, users should have a way to tell the underlying Ably SDK to stop retrying the automatic reconnection. In AAT Android this is done by throwing a special exception or an exception that contains status code 403. For further details look at the Android issue and PR.