Android Guides | Samples

Android.Webkit.GeolocationPermissions Class

This class is used to manage permissions for the WebView's Geolocation JavaScript API.

See Also: GeolocationPermissions

Syntax

[Android.Runtime.Register("android/webkit/GeolocationPermissions", DoNotGenerateAcw=true)]
public class GeolocationPermissions : Object

Remarks

This class is used to manage permissions for the WebView's Geolocation JavaScript API. Geolocation permissions are applied to an origin, which consists of the host, scheme and port of a URI. In order for web content to use the Geolocation API, permission must be granted for that content's origin. This class stores Geolocation permissions. An origin's permission state can be either allowed or denied. This class uses Strings to represent an origin. When an origin attempts to use the Geolocation API, but no permission state is currently set for that origin, WebChromeClient.OnGeolocationPermissionsShowPrompt(string, .ICallback) is called. This allows the permission state to be set for that origin. The methods of this class can be used to modify and interrogate the stored Geolocation permissions at any time.

[Android Documentation]

Requirements

Namespace: Android.Webkit
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 5

The members of Android.Webkit.GeolocationPermissions are listed below.

See Also: Object

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
static
InstanceGeolocationPermissions. Gets the singleton instance of this class.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Allow(String)
Allows the specified origin to use the Geolocation API.
Clear(String)
Clears the Geolocation permission state for the specified origin.
ClearAll()
Clears the Geolocation permission state for all origins.
GetAllowed(String, IValueCallback)
GetOrigins(IValueCallback)