GoogleApiAvailability
GoogleApiAvailability
IMPORTANT! Add next line to manifest:
AddApplicationText()
Events:
- OnMakeGooglePlayServicesAvailableResult (Available As Boolean)
Fields:
- CONNECTION_RESULT_SERVICE_DISABLED As Int
The installed version of Google Play services has been disabled on this device. This is an user resolvable error.
Constant Value: 3
- CONNECTION_RESULT_SERVICE_INVALID As Int
The version of the Google Play services installed on this device is not authentic. This is not an user resolvable error but error dialog will be shown if you call MakeGooglePlayServicesAvailable with ShowInfoDialog=True.
Constant Value: 9
- CONNECTION_RESULT_SERVICE_MISSING As Int
Google Play services is missing on this device. This is an user resolvable error.
Constant Value: 1
- CONNECTION_RESULT_SERVICE_UPDATING As Int
Google Play service is currently being updated on this device. This is not an user resolvable error but error dialog will be shown if you call MakeGooglePlayServicesAvailable with ShowInfoDialog=True.
Constant Value: 18
- CONNECTION_RESULT_SERVICE_VERSION_UPDATE_REQUIRED As Int
The installed version of Google Play services is out of date. This is an user resolvable error.
Constant Value: 2
- CONNECTION_RESULT_SUCCESS As Int
The connection was successful and Google Play Services are available.
Constant Value: 0
Functions:
- CheckAndMakeGooglePlayServicesAvailable (EventName As String, ShowInfoDialog As Boolean)
Checks and attempts to make Google Play services available on this device if it is not available. Event OnMakeGooglePlayServicesAvailableResult will be fired when fixing procedure is finished by user or if fixing procedure is not required.
EventName: name of event to be fired.
ShowInfoDialog: True to show dialog which displays a localized message about the error and upon user confirmation (by tapping on dialog) will direct them to the Play Store if Google Play services is out of date or missing, or to system settings if Google Play services is disabled on the device. False to start solution activity without showing error dialog.
- MakeGooglePlayServicesAvailable (EventName As String, ShowInfoDialog As Boolean, ConnectionResult As Int)
Attempts to make Google Play services available on this device if it is not available. Event OnMakeGooglePlayServicesAvailableResult will be fired when fixing procedure is finished by user or if fixing procedure is not required.
EventName: name of event to be fired.
ShowInfoDialog: True to show dialog which displays a localized message about the error and upon user confirmation (by tapping on dialog) will direct them to the Play Store if Google Play services is out of date or missing, or to system settings if Google Play services is disabled on the device. False to start solution activity without showing error dialog.
ConnectionResult: integer value returned by IsGooglePlayServicesAvailable2 call. If it is equal CONNECTION_RESULT_SUCCESS then OnMakeGooglePlayServicesAvailableResult event will be fired immediately with True result.
- ShowErrorNotification
Displays a notification for an error code returned from IsGooglePlayServicesAvailable2, if it is resolvable by the user.
Properties:
- ErrorResolutionIntent As Intent [read only]
Returns the intent which will direct the user to either the Play Store if Google Play services is out of date or missing, or system settings if Google Play services is disabled on the device.
- GooglePlayServicesPackageName As String [read only]
Returns package name for Google Play services.
- GooglePlayServicesSettingsIntent As Intent [read only]
Returns Google Play Services settings intent.
- GooglePlayServicesUpdateIntent As Intent [read only]
Returns Google Play Services install or update intent.
- GooglePlayServicesVersionCode As Int [read only]
Returns Google Play services client library version code.
- GooglePlayStorePackageName As String [read only]
Returns package name for Google Play Store application.
- IsGooglePlayServicesAvailable As Boolean [read only]
Returns True if Google Play services is installed and enabled on this device, and if the version installed on this device is no older than the one required by this client. Otherwise returns False.
- IsGooglePlayServicesAvailable2 As Int [read only]
Verifies that Google Play services is installed and enabled on this device, and that the version installed on this device is no older than the one required by this client.
Returns one of following int values: CONNECTION_RESULT_SUCCESS, CONNECTION_RESULT_SERVICE_MISSING, CONNECTION_RESULT_SERVICE_UPDATING, CONNECTION_RESULT_SERVICE_VERSION_UPDATE_REQUIRED, CONNECTION_RESULT_SERVICE_DISABLED and CONNECTION_RESULT_SERVICE_INVALID.
- IsPlayServicesPossiblyUpdating As Boolean [read only]
Returns True if Google Play Service can be updated and if a new version exists. Otherwise False.
- IsPlayStorePossiblyUpdating As Boolean [read only]
Returns True if Google Play Store can be updated and if a new version exists. Otherwise False.
- IsUserResolvableError As Boolean [read only]
Returns True whether an error can be resolved via user action or if Google Play Services are available.