Skip to content

Commit

Permalink
fix: Web 端未集成圈选插件时,显示对应提示
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Dec 14, 2022
1 parent acece74 commit 944919a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Modules/Hybrid/GrowingWKWebViewJavascriptBridge_JS.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@implementation GrowingWKWebViewJavascriptBridge_JS

NSString *WKWebViewJavascriptBridge_js(void) {
static NSString *kWKWebViewJavascriptBridge_js(void) {
#define __WKWebViewJavascriptBridge_js_func__(x) #x

// BEGIN preprocessorJSCode
Expand All @@ -32,14 +32,19 @@ @implementation GrowingWKWebViewJavascriptBridge_JS
}

window.GrowingWebViewJavascriptBridge = {
configuration: %@,
configuration: $configuration_replacement,
dispatchEvent: dispatchEvent,
setNativeUserId: setNativeUserId,
clearNativeUserId: clearNativeUserId,
setNativeUserIdAndUserKey: setNativeUserIdAndUserKey,
clearNativeUserIdAndUserKey: clearNativeUserIdAndUserKey,
onDomChanged: onDomChanged
onDomChanged: onDomChanged,
getDomTree: getDomTreeTemp
};

function getDomTreeTemp() {
console.log("%c [GrowingIO]:圈选获取节点信息失败!请集成 gioHybridCircle 插件后重试!", "color: #F59E0B;");
}

function dispatchEvent(event) {
_doSend("dispatchEvent", event);
Expand Down Expand Up @@ -83,7 +88,8 @@ function _doSend(messageType, data) {
};

+ (NSString *)createJavascriptBridgeJsWithNativeConfiguration:(GrowingWebViewJavascriptBridgeConfiguration *)configuration {
return [NSString stringWithFormat:WKWebViewJavascriptBridge_js(), [configuration toJsonString]];
NSString *bridge = kWKWebViewJavascriptBridge_js();
return [bridge stringByReplacingOccurrencesOfString:@"$configuration_replacement" withString:[configuration toJsonString]];
}

@end

0 comments on commit 944919a

Please sign in to comment.