Skip to content

Commit 791367b

Browse files
authored
Merge pull request #281 from GreatQin1/sig
fix: 修复获取地理位置信息失败问题
2 parents 81d6e40 + bfb4bad commit 791367b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

harmony/rn_webview/src/main/ets/RNCWebView.ets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ export struct RNCWebView {
431431
.onConfirm((event: AlertEvent) => this.onJavascriptConfirm(event))
432432
.onDownloadStart((event: OnDownloadStartEvent) => this.webViewBaseOperate?.onDownloadStart(event))
433433
.geolocationAccess(this.descriptorWrapper.rawProps.geolocationEnabled)
434+
.onGeolocationShow((event) => {
435+
if (event && (this.descriptorWrapper.rawProps.geolocationEnabled != undefined)) {
436+
event.geolocation.invoke(event.origin, this.descriptorWrapper.rawProps.geolocationEnabled, true);
437+
}
438+
})
434439
.mediaPlayGestureAccess(this.descriptorWrapper.rawProps.mediaPlaybackRequiresUserAction)
435440
.onRenderExited((event: OnRenderExitedEvent) => this.webViewBaseOperate?.onRenderExited(event))
436441
.onLoadIntercept((event: OnLoadInterceptEvent) => this.onLoadIntercept(event))

0 commit comments

Comments
 (0)