@react-native-ohos/react-native-webview 13.15.1-rc.4 → 13.15.1-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  "name": "@react-native-ohos/react-native-webview",
7
7
  "description": "main cpai architecture",
8
8
  "main": "index.ets",
9
- "version": "13.15.1-rc.4",
9
+ "version": "13.15.1-rc.5",
10
10
  "dependencies": {
11
11
  "@rnoh/react-native-openharmony": "../react_native_openharmony.har"
12
12
  }
@@ -27,7 +27,7 @@ import {
27
27
  MINHEIGHT,
28
28
  } from './Magic';
29
29
 
30
- import { bundleManager } from '@kit.AbilityKit';
30
+ import { abilityAccessCtrl, bundleManager } from '@kit.AbilityKit';
31
31
  import { WebViewTurboModule, ShouldStartParams, ShouldOverrideCallbackState } from './WebViewTurboModule';
32
32
  import { AnyThreadRNInstance, WorkerTaskRunnable } from '@rnoh/react-native-openharmony/src/main/ets/RNOH';
33
33
  import buffer from '@ohos.buffer';
@@ -43,6 +43,8 @@ class WorkerRunnable implements WorkerTaskRunnable<ShouldStartParams> {
43
43
  }
44
44
  }
45
45
 
46
+ let atManager = abilityAccessCtrl.createAtManager();
47
+
46
48
  @Component
47
49
  export struct RNCWebView {
48
50
  public static readonly NAME = RNC.RNCWebView.NAME
@@ -117,6 +119,10 @@ export struct RNCWebView {
117
119
  }
118
120
  })
119
121
  }
122
+ atManager.requestPermissionsFromUser(this.ctx.uiAbilityContext, ["ohos.permission.APPROXIMATELY_LOCATION"]).then((data) => {
123
+ }).catch((error: BusinessError) => {
124
+ console.error(`Failed to request permissions from user. Code is ${error.code}, message is ${error.message}`);
125
+ })
120
126
  } catch (error) {
121
127
  Logger.error(TAG, `[RNOH]Errorcode: ${error.code}, Message: ${error.message}`);
122
128
  }
@@ -274,6 +280,7 @@ export struct RNCWebView {
274
280
  this.webViewBaseOperate.setCustomUserAgent(this.descriptorWrapper.rawProps.userAgent,
275
281
  this.descriptorWrapper.rawProps.applicationNameForUserAgent)
276
282
  this.webViewBaseOperate.setFraudulentWebsiteWarningEnabled(this.descriptorWrapper.rawProps.fraudulentWebsiteWarningEnabled)
283
+
277
284
  let baseUrl = this.source.baseUrl
278
285
  let uri = this.source.uri
279
286
  if (this.source.html != undefined && this.source.html != "") {
Binary file
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "Thibault Malbranche <malbranche.thibault@gmail.com>"
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "13.15.1-rc.4",
12
+ "version": "13.15.1-rc.5",
13
13
  "homepage": "https://gitcode.com/openharmony-sig/rntpc_react-native-webview/tree/br_rnoh0.77#readme",
14
14
  "scripts": {
15
15
  "macos": "react-native run-macos --scheme WebviewExample --project-path example/macos",
@@ -48,7 +48,6 @@
48
48
  "@react-native/eslint-config": "0.73.2",
49
49
  "@react-native/metro-config": "0.73.5",
50
50
  "@react-native/typescript-config": "0.73.1",
51
- "@react-native-oh/react-native-harmony-cli": "file:./packages/react-native-oh-react-native-harmony-cli-0.77.18.tgz",
52
51
  "@rnx-kit/metro-config": "1.3.15",
53
52
  "@semantic-release/git": "7.0.16",
54
53
  "@types/invariant": "^2.2.30",