Skip to content

Commit

Permalink
fix(hybrid): web js sdk init logic
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Oct 15, 2024
1 parent c818268 commit 4aa2274
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
GrowingAnalytics: e845c52ebff18c53659b5e37e75fb50e2097dc32
GrowingAnalytics: a21d9a825784987038a6ce37c10c00ec591195f6
GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b
GrowingToolsKit: 53160d19690da0b78e04a9242abde7af86442922
GrowingUtils: 68aee2c96849bf9b674740503da30c2da468e79d
Expand Down
38 changes: 20 additions & 18 deletions Modules/Hybrid/GrowingWKWebViewJavascriptBridge_JS.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,26 @@ + (NSString *)createJavascriptBridgeJsWithNativeConfiguration:
#define __WKWebViewJavascriptSdkInject_js_func__(x) #x

// BEGIN preprocessorJSCode
static NSString *kGrowingPreprocessorJSCode =
@__WKWebViewJavascriptSdkInject_js_func__(!(function (e, n, t, s, c) {
var o;
e[s] =
e[s] ||
function () {
(e[s].q = e[s].q || []).push(arguments);
};
(c = c || 'vds'),
(e._gio_local_vds = c),
(e[c] = null !== (o = e[c]) && void 0 !== o ? o : {}),
(e[c].namespace = s);
var d = n.createElement('script');
var i = n.getElementsByTagName('script')[0];
(d.async = !0), (d.src = t), i.parentNode.insertBefore(d, i);
})(window, document, 'https://assets.giocdn.com/sdk/webjs/gdp-full.js', 'gdp');

gdp('init', '$accountId_replacement', '$dataSourceId_replacement'););
static NSString *kGrowingPreprocessorJSCode = @__WKWebViewJavascriptSdkInject_js_func__(
try{
!(function (e, n, t, s, c) {
e[s] =
e[s] ||
function () {
(e[s].q = e[s].q || []).push(arguments);
};
(e._gio_local_vds = c = c || 'vds'),
(e[c] = e[c] || {}),
(e[c].namespace = s);
var d = n.createElement('script');
var i = n.getElementsByTagName('script')[0];
(d.async = !0), (d.src = t);
i ? i.parentNode.insertBefore(d, i) : n.head.appendChild(d);
})(window, document, 'https://assets.giocdn.com/sdk/webjs/gdp-full.js', 'gdp');

window._gr_ignore_local_rule = true;
gdp('init', '$accountId_replacement', '$dataSourceId_replacement');
} catch(e){});
#undef __WKWebViewJavascriptSdkInject_js_func__
return kGrowingPreprocessorJSCode;
};
Expand Down

0 comments on commit 4aa2274

Please sign in to comment.