Our Android libraries have been updated to include the latest features from OkHi, such as the ability to pass your own system user IDs and enhanced security updates while providing a simpler and cleaner API.
Please follow these steps if you are using older library versions.
Change your compile SDK
The OkHi libraries target Android devices >= SDK 21. Make sure you've updated your compileSdkVersion & targetSdkVersion to 34 in your app/build.gradle file.
To this which has one less parameter which is the removal of OkCollectLaunchMode.CREATE and OkCollectCallback that has also changed.
The onSuccess function has also been updated.
okCollect.launch(createOkHiUser(), new OkCollectCallback<OkCollectSuccessResponse>() {
@Override
public void onSuccess(OkCollectSuccessResponse response) {
startAddressVerification(response);
}
@Override
public void onClose() {
showMessage("User closed.");
}
@Override
public void onError(OkHiException e) {
showMessage(e.getCode() + ":" + e.getMessage());
}
});
To accessing the user and location properties, you do this:
OkHiUser user = response.getUser();
OkHiLocation location = response.getLocation();
OkHiUser
This builder has changed from this:
OkHiUser user = new OkHiUser.Builder("+234...")
.withFirstName("Jane")
.withLastName("Doe")
.withEmail("jane@okhi.co")
.build();
To this which has the withAppUserId for passing your system's user ID if you want to pass it
OkHiUser user = new OkHiUser.Builder("+254...")
.withFirstName("Jane")
.withLastName("Doe")
.withEmail("jane@okhi.co")
.withAppUserId("abcd1234")
.build();