ably / ably-asset-tracking-swift

iOS client SDKs for the Ably Asset Tracking service.
Apache License 2.0
9 stars 6 forks source link

Handle properly the error paths for the callback based auth #374

Open KacperKluka opened 1 year ago

KacperKluka commented 1 year ago

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.

deanna-lad commented 1 year ago

The corresponding Jira issue is https://ably.atlassian.net/browse/SDK-2653