fix(access-token): match iOS interface for getAccessToken() on Android #954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses issue #937
I replicated the behaviour of
getAccessToken()
on iOS in the native Android code. Both iOS and Android versions now return a promise that either resolves to a string, or is rejected if the access token is null. Previously, the Android version returned a promise that resolved to an object with anaccessToken
property having the value of the access token.This is a breaking change, changing the interface of
getAccessToken()
on Android.Testing performed
I completed manual testing from a basic app similar to the getting started example, not knowing how or if I should add tests for native Android code:
getAccessToken()
returns a string equal to the access token set previously throughsetAccessToken()
.getAccessToken()
rejects the promise with an error message ifnull
was previously set as the access token throughsetAccessToken()
.I tested the basic app on an Android emulator (API level 28) and on a physical device (Google Pixel, Android 10 build number QP1A.191005.007.A3). The client app uses React Native Version 0.62.2.
I do not have an iOS development environment to test with.