openharmony 鸿蒙 arkts-basic-components-web-JsGeolocation

2026-08-25 浏览 (1)

Class (JsGeolocation)

Implements the PermissionRequest object. For details about the sample code, see onGeolocationShow.

NOTE

  • The initial APIs of this component are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.

  • The initial APIs of this class are supported since API version 8.

  • The sample effect is subject to the actual device.

constructor

constructor()

Constructs a JsGeolocation object.

System capability: SystemCapability.Web.Webview.Core

invoke

invoke(origin: string, allow: boolean, retain: boolean): void

Sets the geolocation permission status of a web page.

System capability: SystemCapability.Web.Webview.Core

Parameters

NameTypeMandatoryDescription
originstringYesIndex of the origin.
allowbooleanYesGeolocation permission status.
The value true means to enable the geolocation permission, and false means the opposite.
retainbooleanYesWhether the geolocation permission status can be saved to the system. You can manage the geolocation permissions saved to the system through the GeolocationPermissions9+ API.
The value true indicates that the geolocation permission status can be saved to the system, and false indicates the opposite.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-webview-WebviewController

openharmony 鸿蒙 arkts-apis-webview-t

openharmony 鸿蒙 arkts-apis-webview

openharmony 鸿蒙 capi-arkweb-type-h

openharmony 鸿蒙 arkts-basic-components-web-FullScreenExitHandler

openharmony 鸿蒙 arkts-apis-webview-WebDownloadManager

openharmony 鸿蒙 arkts-basic-components-web-VerifyPinHandler

openharmony 鸿蒙 capi-web-arkweb-webmessage8h

openharmony 鸿蒙 arkts-apis-webview-NativeMediaPlayerHandler

openharmony 鸿蒙 capi-web-arkweb-proxymethodwithresult

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/TlVEe8NB