setGeolocationPermissionsPromptCallbacks method

Future<void> setGeolocationPermissionsPromptCallbacks({
  1. OnGeolocationPermissionsShowPrompt? onShowPrompt,
  2. OnGeolocationPermissionsHidePrompt? onHidePrompt,
})

Sets the callback that is invoked when the client request handle geolocation permissions.

Param onShowPrompt notifies the host application that web content from the specified origin is attempting to use the Geolocation API, but no permission state is currently set for that origin.

The host application should invoke the specified callback with the desired permission state. See GeolocationPermissions for details.

Note that for applications targeting Android N and later SDKs (API level > Build.VERSION_CODES.M) this method is only called for requests originating from secure origins such as https. On non-secure origins geolocation requests are automatically denied.

Param onHidePrompt notifies the host application that a request for Geolocation permissions, made with a previous call to onGeolocationPermissionsShowPrompt() has been canceled. Any related UI should therefore be hidden.

See https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback)

See https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsHidePrompt()

Implementation

Future<void> setGeolocationPermissionsPromptCallbacks({
  OnGeolocationPermissionsShowPrompt? onShowPrompt,
  OnGeolocationPermissionsHidePrompt? onHidePrompt,
}) async {
  _onGeolocationPermissionsShowPrompt = onShowPrompt;
  _onGeolocationPermissionsHidePrompt = onHidePrompt;
}