OkVerify API Reference

API reference for the OkCollect Verify Android library

This document is deprecated. Please use the official JavaDoc

Static methods

init()

Attempts to register erroneous geofences silently at app start and other foreground clean up processes

isGooglePlayServicesAvailable(Context context): boolean

Checks if Google Play services is available. Returns true | false

isLocationPermissionGranted(Context context): boolean

Checks if location permission is granted. Returns true | false

isLocationServicesEnabled(Context context): boolean

Checks if the device's location services are enabled: Returns true | false

openLocationServicesSettings(Activity activity): void

Launches the devices location services settings

stop(Context context, String locationId): void

Stops the verification process of an OkHi address

Instance methods

start(OkHiUser user, OkHiLocation location, OkVerifyCallback<String> handler): void

Starts the OkHi address verification process

requestEnableGooglePlayServices(OkVerifyRequestHandler handler): void

Launches the device's Google Play Services app page, prompting the user to enable the service

requestEnableLocationServices(OkVerifyRequestHandler handler): void

Displays a native dialog box, in app, prompting the user to enable the service

requestLocationPermission(String rationaleTitle, String rationaleMessage, OkVerifyRequestHandler handler): void

Requests location permission from the user

onActivityResult(int requestCode, int resultCode, Intent data): void

Used to determine whether a requested service from the library has been enabled or disabled by the user

onRequestPermissionsResult(int requestCode, String [ ] permissions, int [ ] grantResults): void

Used to determine whether a requested permission from the library has been granted

Interfaces

OkVerifyCallback<T>

Used to manage responses from the verification process. onSuccess() method will be invoked when the verification process has started successfully. onError(OkHiException e) method will be invoked when something goes wrong with starting the verification process.

OkVerifyRequestHandler

Used to manage responses from attempting to start a service or result from requesting permission from the user. onSuccess() method will be invoked when the process has started successfully or permission granted. onError(OkHiException e) method will be invoked when user doesn't enable the service or denies the requested permission.

OkHiException

See class

Code

Message

Description

network_error

Unable to establish a connection with OkHi servers

The device doesn't have internet access

unknown_error

Unable to process the request. Something went wrong

An unknown exception occurred in the verification process

invalid_phone

Invalid phone number provided. Please make sure its in MSISDN standard format

The phone number associated with the OkHiUser is invalid

unauthorized

Invalid credentials provided

Invalid credentials have been used to configure OkVerify

service_unavailable

The requested service is unavailable

Thrown as a result from a critical device service being unavailable e.g location services

permission_denied

The requested permission hasn't been granted by the user

Thrown as a result from the user denying location permissions

Check out our JavaDoc for up-to-date references

Last updated