Skip to content

Commit d655dcb

Browse files
committed
docs: update readme
1 parent 2971bef commit d655dcb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎docs/user-guide.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,14 @@ It is advised you use auth methods from `useIgnite()` in the above section inste
190190

191191
#### Refresh Token
192192

193-
The Accounts SDK only returns an access token, not a refresh token. If the user is logged in and `getToken()` ever returns `null`, the refresh token may have expired. In this situation you can either call `logout()` so the user can manually login again to refresh the refresh token and receive a new access token or you can call `refreshToken()` which will automatically present the login UI to the user (you must use `useIgnite`'s `refreshToken()` method to trigger this behaviour on Android). If you do not need to use an OAuth access token from the Accounts SDK, you typically do not need to worry about this and can rely on `isLoggedIn` from `useIgnite()` to control your login UI state.
193+
The Accounts SDK only returns an access token, not a refresh token. If the user is logged in and `getToken()` ever returns `null`, the refresh token may have expired. In this situation you can either call `logout()` so the user can manually login again to refresh the refresh token and receive a new access token or you can call `refreshToken()` which will automatically present the login UI to the user (you must use `useIgnite`'s `refreshToken()` method to trigger this behaviour or the login UI will only be presented for iOS).
194194

195-
On recent versions of the iOS Accounts SDK, it has been observed that on backend server errors `getToken()` and `getMemberInfo()` methods are returning `TicketmasterFoundation.ConnectionError error...` instead of `null`. In these situations, if the user has previously logged in `isLoggedIn` from `useIgnite()` will be `true`, so `isLoggedIn` is a good variable to use to control the logged in UI state of the whole application, it also works well in useEffect dep arrays. `await getIsLoggedIn()` is good to call directly after methods like `await login()` or `await refreshToken()` to check/retrieve a boolean which states if the user is logged in which can be used for your own custom variables or conditions in your business logic.
195+
On recent versions of the iOS Accounts SDK, it has been observed that on backend server errors such as expired tokens, `getToken()` and `getMemberInfo()` methods are returning `TicketmasterFoundation.ConnectionError error...` instead of `null`. In these situations, if the user has previously logged in `isLoggedIn` from `useIgnite()` will be `true`, so if you don't want a logged out state for your UI, `isLoggedIn` is a good variable to use to control the logged in UI state of any ticket screens, it also works well in `useEffect` dep arrays. `await getIsLoggedIn()` is good to call directly after methods like `await login()` or `await refreshToken()` to check/retrieve a boolean which states if the user is logged in which can be used for your own custom variables or conditions in your business logic.
196196

197-
As a fail safe, it may be beneficial to call `refreshToken()` **once** on the first log occurrence of `TicketmasterFoundation.ConnectionError error...` being logged a catch block, in case the user just needs to re-authenticate, but a backend server error should resolve itself after a short period of time (within 5 mins) so a "something went wrong, please try again later" error message to the user may suffice on an occurrence of this error.
197+
As a fail safe, it may be beneficial to call `refreshToken()` at least **once** on the first log occurrence of `TicketmasterFoundation.ConnectionError error...` being logged in a catch block, in case the user just needs to re-authenticate.
198+
199+
To catch any Accounts SDK configuration errors on app launch which is sometimes due to `TicketmasterFoundation.ConnectionError error 0` backend errors see [here](#detecting-accounts-sdk-configuration-failures-on-app-launch)
198200

199-
To catch `TicketmasterFoundation.ConnectionError error 0` logs on app launch see [here](#detecting-accounts-sdk-configuration-failures-on-app-launch)
200201

201202
#### Reconfigure Accounts SDK
202203

0 commit comments

Comments
 (0)