Update and Error Handling APIs

The Google Play services APK contains the individual Google services and runs as a background service in the Android OS. The Google Play Services Update and Error Handling APIs help you verify if the Google Play Services APK is available on the device, and whether it is up-to-date.

By using the Google Play Services Update and Error Handling APIs, you can check the status of availability of the Google Play Services APK on the device. You can also display notifications about the error or display error resolution dialog boxes, that upon confirmation from the user, will direct them to the Google Play Store (if Google Play services is out of date or missing on the device) or to the system settings (if Google Play services is disabled on the device).

The Google Play Services Update and Error Handling APIs use the kony.gms namespace and contain the following API elements.

Function Description
kony.gms.getStatusString Returns the statusCode in a human-readable string format.
kony.gms.isBaseLibraryAvailable Checks whether the base client library is integrated with the application.
kony.gms.isGooglePlayServicesAvailable Checks whether Google Play Services is installed and enabled on the device.
kony.gms.isUserResolvableError Determines whether an error can be resolved through a user action such as, on a dialog box or a notification.
kony.gms.makeGooglePlayServicesAvailable Displays a dialog box to address any errors based on the value of the statusCode parameter.
kony.gms.raiseGooglePlayErrorResolutionIntent Used to address the statusCode that is returned by the kony.gms.isGooglePlayServicesAvailable, if it can be resolved by the user.
kony.gms.showCustomErrorNotification Displays a customized notification to address the statusCode that is returned, if it can be resolved by the user.
kony.gms.showErrorNotification Displays a system notification to address the statusCode that is returned, if it can be resolved by the user.
kony.gms.showResolutionDialog Displays a dialog box to address any errors based on the value of the statusCode parameter.
 

Use the kony.gms.isBaseLibraryAvailable and the kony.gms.isGooglePlayServicesAvailable to check whether the base client library is integrated with the application and if the Google Play Services is installed and enabled on the device respectively. If the Google Play Services is not available, use the kony.gms.isUserResolvableError to check if the error can be resolved through a user action, and then invoke the kony.gms.raiseGooglePlayErrorResolutionIntent or the kony.gms.makeGooglePlayServicesAvailable APIs to address the status code or display a dialog box that provides users with the UI to enable Google Play Services. The kony.gms.getStatusString API displays the statusCode in a human-readable string format. Use the kony.gms.showErrorNotification, kony.gms.showCustomErrorNotification, and kony.gms.showResolutionDialog APIs to display system notifications, custom notifications, and dialog boxes to address any errors.