Skip to content

Commit 73010dd

Browse files
Update README.md
1 parent 080f956 commit 73010dd

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,23 @@ SHRMPluginResult *result = [SHRMPluginResult resultWithStatus:SHRMCommandStatus_
107107
### 3.自定义业务插件(JS侧)
108108

109109
JS侧目前还没有开放插件化功能,只是说还不够完善,但它不影响功能使用:
110-
1. 如果JS加载在WKWebView,JS调用Native通过`window.webkit.messageHandlers.SHRMWKJSBridge.postMessage(['13383445','SHRMFetchPlugin','nativeFentch',['post','https:www.baidu.com','user']])`即可,`['post','https:www.baidu.com','user']`为想要传递的参数。`13383445`为此次通信ID,`SHRMFetchPlugin`为Native侧插件类名,`nativeFentch`为插件方法名。
111-
2. 如果JS加载在UIWebView,JS调用Native通过`postUIWebViewParamer(['13383446','SHRMTestUIWebViewPlguin','nativeTestUIWebView',['post','openFile','user']])`即可,其中`['post','openFile','user']`依旧为你想要传递的参数,另外三个参数含义同上。
110+
1. 如果JS加载在`WKWebView`,JS调用Native通过
111+
```
112+
window.webkit.messageHandlers.SHRMWKJSBridge.postMessage(['13383445','SHRMFetchPlugin','nativeFentch',['post','https:www.baidu.com','user']])
113+
```
114+
即可。
115+
`['post','https:www.baidu.com','user']`为想要传递的参数。
116+
`13383445`为此次通信ID。
117+
`SHRMFetchPlugin`为Native侧插件类名。
118+
`nativeFentch`为插件方法名。
119+
120+
2. 如果JS加载在`UIWebView`,JS调用Native通过
121+
```
122+
postUIWebViewParamer(['13383446','SHRMTestUIWebViewPlguin','nativeTestUIWebView',['post','openFile','user']])
123+
```
124+
即可,其中`['post','openFile','user']`
125+
依旧为你想要传递的参数,另外三个参数含义同上。
126+
112127
3. 详细使用参照Demo。
113128

114129
## 后续功能延伸:

0 commit comments

Comments
 (0)