Skip to content

Commit aa518b3

Browse files
author
shengyonggen
committed
app和js打通的改成json跟事
1 parent 0ac689c commit aa518b3

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

sensorsdata.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sdk.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,9 @@ saEvent.send = function(p, callback) {
17341734
var todo = null;
17351735
function setAppInfo(data){
17361736
app_info = data;
1737+
if(_.isJSONString(app_info)){
1738+
app_info = json.parse(app_info);
1739+
}
17371740
if(todo){
17381741
todo(data);
17391742
}
@@ -1742,6 +1745,9 @@ saEvent.send = function(p, callback) {
17421745
function getAndroid(){
17431746
if(typeof window.SensorsData_APP_JS_Bridge === 'object' && window.SensorsData_APP_JS_Bridge.sensorsdata_call_app){
17441747
app_info = SensorsData_APP_JS_Bridge.sensorsdata_call_app();
1748+
if(_.isJSONString(app_info)){
1749+
app_info = json.parse(app_info);
1750+
}
17451751
}
17461752
}
17471753
//ios

src/sensorsdata.full.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,9 @@ saEvent.send = function(p, callback) {
23382338
var todo = null;
23392339
function setAppInfo(data){
23402340
app_info = data;
2341+
if(_.isJSONString(app_info)){
2342+
app_info = json.parse(app_info);
2343+
}
23412344
if(todo){
23422345
todo(data);
23432346
}
@@ -2346,6 +2349,9 @@ saEvent.send = function(p, callback) {
23462349
function getAndroid(){
23472350
if(typeof window.SensorsData_APP_JS_Bridge === 'object' && window.SensorsData_APP_JS_Bridge.sensorsdata_call_app){
23482351
app_info = SensorsData_APP_JS_Bridge.sensorsdata_call_app();
2352+
if(_.isJSONString(app_info)){
2353+
app_info = json.parse(app_info);
2354+
}
23492355
}
23502356
}
23512357
//ios

vtrack.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)