1413 lines
39 KiB
Plaintext
1413 lines
39 KiB
Plaintext
|
mergeInto(LibraryManager.library, {
|
||
|
_isdebug: false,
|
||
|
_log: function (isdebug) {
|
||
|
try{
|
||
|
_isdebug=isdebug;
|
||
|
}catch (error) {
|
||
|
console.log("An error occurred in _log:", error);
|
||
|
}
|
||
|
|
||
|
},
|
||
|
_ready: function () {
|
||
|
SendMessage("SESDKBridge", "readyFun");
|
||
|
},
|
||
|
|
||
|
_prevInit_dy: function (appkey) {
|
||
|
try {
|
||
|
var _appkey = UTF8ToString(appkey);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_prevInit :", " appkey:", _appkey);
|
||
|
globalThis.SESDK.prevInit(_appkey);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _prevInit_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_prevInit_wx: function (appkey) {
|
||
|
try {
|
||
|
var _appkey = UTF8ToString(appkey);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_prevInit :", " appkey:", _appkey);
|
||
|
GameGlobal.SESDK.prevInit(_appkey);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _prevInit_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_init_dy: function (initParams) {
|
||
|
try {
|
||
|
var _initParams = UTF8ToString(initParams);
|
||
|
var jsonObject = {};
|
||
|
if (_initParams != "") jsonObject = JSON.parse(_initParams);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_init :", " initParams:", jsonObject);
|
||
|
globalThis.SESDK.init(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _init_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
_init_wx: function (initParams) {
|
||
|
try {
|
||
|
var _initParams = UTF8ToString(initParams);
|
||
|
var jsonObject = {};
|
||
|
if (_initParams != "") jsonObject = JSON.parse(_initParams);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_init :", " initParams:", jsonObject);
|
||
|
|
||
|
jsonObject.config.tencentAdvertisingGameSDK=GameGlobal.SDK;
|
||
|
|
||
|
GameGlobal.SESDK.init(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _init_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_abtestuse_dy: function () {
|
||
|
try {
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_abtestuse");
|
||
|
globalThis.SESDK.use(globalThis.miniabtestPlugin);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _abtestuse_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
_abtestuse_wx: function () {
|
||
|
try {
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_abtestuse", GameGlobal.miniabtestPlugin);
|
||
|
GameGlobal.SESDK.use(GameGlobal.miniabtestPlugin);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _abtestuse_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_setRemoteDefaultConfig_dy: function (config) {
|
||
|
try {
|
||
|
var _config = UTF8ToString(config);
|
||
|
var jsonObject = {};
|
||
|
if (_config != "") jsonObject = JSON.parse(_config);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_setRemoteDefaultConfig :", "_config:", jsonObject);
|
||
|
globalThis.SESDK.setRemoteDefaultConfig(jsonObject || []);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setRemoteDefaultConfig_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
_setRemoteDefaultConfig_wx: function (config) {
|
||
|
try {
|
||
|
var _config = UTF8ToString(config);
|
||
|
var jsonObject = {};
|
||
|
if (_config != "") jsonObject = JSON.parse(_config);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_setRemoteDefaultConfig :", "_config:", jsonObject);
|
||
|
GameGlobal.SESDK.setRemoteDefaultConfig(jsonObject || []);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setRemoteDefaultConfig_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setRemoteConfigEventProperties_dy: function (properties) {
|
||
|
try {
|
||
|
var _properties = UTF8ToString(properties);
|
||
|
var jsonObject = {};
|
||
|
if (_properties != "") jsonObject = JSON.parse(_properties);
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"douyin_setRemoteConfigEventProperties :",
|
||
|
" properties:",
|
||
|
jsonObject
|
||
|
);
|
||
|
globalThis.SESDK.setRemoteConfigEventProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log(
|
||
|
"An error occurred in _setRemoteConfigEventProperties_dy:",
|
||
|
error
|
||
|
);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setRemoteConfigEventProperties_wx: function (properties) {
|
||
|
try {
|
||
|
var _properties = UTF8ToString(properties);
|
||
|
var jsonObject = {};
|
||
|
if (_properties != "") jsonObject = JSON.parse(_properties);
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"weixin_setRemoteConfigEventProperties :",
|
||
|
" properties:",
|
||
|
jsonObject
|
||
|
);
|
||
|
GameGlobal.SESDK.setRemoteConfigEventProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log(
|
||
|
"An error occurred in _setRemoteConfigEventProperties_wx:",
|
||
|
error
|
||
|
);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setRemoteConfigUserProperties_dy: function (properties) {
|
||
|
try {
|
||
|
var _properties = UTF8ToString(properties);
|
||
|
var jsonObject = {};
|
||
|
if (_properties != "") jsonObject = JSON.parse(_properties);
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"douyin_setRemoteConfigUserProperties :",
|
||
|
" properties:",
|
||
|
jsonObject
|
||
|
);
|
||
|
globalThis.SESDK.setRemoteConfigUserProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log(
|
||
|
"An error occurred in _setRemoteConfigUserProperties_dy:",
|
||
|
error
|
||
|
);
|
||
|
}
|
||
|
},
|
||
|
_setRemoteConfigUserProperties_wx: function (properties) {
|
||
|
try {
|
||
|
var _properties = UTF8ToString(properties);
|
||
|
var jsonObject = {};
|
||
|
if (_properties != "") jsonObject = JSON.parse(_properties);
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"weixin_setRemoteConfigUserProperties :",
|
||
|
" properties:",
|
||
|
jsonObject
|
||
|
);
|
||
|
GameGlobal.SESDK.setRemoteConfigUserProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log(
|
||
|
"An error occurred in _setRemoteConfigUserProperties_wx:",
|
||
|
error
|
||
|
);
|
||
|
}
|
||
|
},
|
||
|
_fastFetchRemoteConfig_dy: function (key) {
|
||
|
try {
|
||
|
var _key = UTF8ToString(key);
|
||
|
|
||
|
var value = "unknown";
|
||
|
|
||
|
value = globalThis.SESDK.fastFetchRemoteConfig(_key).toString();
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"douyin_fastFetchRemoteConfig :",
|
||
|
" key:",
|
||
|
_key,
|
||
|
" value:",
|
||
|
value
|
||
|
);
|
||
|
|
||
|
if (typeof value !== "string") {
|
||
|
return UTF8ToString("unknown");
|
||
|
}
|
||
|
|
||
|
var bufferSize = lengthBytesUTF8(value) + 1;
|
||
|
var buffer = _malloc(bufferSize);
|
||
|
stringToUTF8(value, buffer, bufferSize);
|
||
|
return buffer;
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _fastFetchRemoteConfig_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_fastFetchRemoteConfig_wx: function (key) {
|
||
|
try {
|
||
|
var _key = UTF8ToString(key);
|
||
|
|
||
|
var value = "unknown";
|
||
|
|
||
|
value = GameGlobal.SESDK.fastFetchRemoteConfig(_key).toString();
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"weixin_fastFetchRemoteConfig :",
|
||
|
" key:",
|
||
|
_key,
|
||
|
" value:",
|
||
|
value
|
||
|
);
|
||
|
|
||
|
if (typeof value !== "string") {
|
||
|
return UTF8ToString("unknown");
|
||
|
}
|
||
|
|
||
|
var bufferSize = lengthBytesUTF8(value) + 1;
|
||
|
var buffer = _malloc(bufferSize);
|
||
|
stringToUTF8(value, buffer, bufferSize);
|
||
|
return buffer;
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _fastFetchRemoteConfig_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_asyncFetchRemoteConfig_dy: function (key) {
|
||
|
try {
|
||
|
var _key = UTF8ToString(key);
|
||
|
|
||
|
globalThis.SESDK.asyncFetchRemoteConfig(_key).then(function (value) {
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"douyin _asyncFetchRemoteConfig",
|
||
|
" key:",
|
||
|
_key,
|
||
|
" value:",
|
||
|
JSON.stringify(value)
|
||
|
);
|
||
|
|
||
|
var myObject = {
|
||
|
key: _key,
|
||
|
value: value.toString(),
|
||
|
};
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"douyin _asyncFetchRemoteConfig",
|
||
|
" key:",
|
||
|
_key,
|
||
|
" value:",
|
||
|
JSON.stringify(myObject)
|
||
|
);
|
||
|
SendMessage(
|
||
|
"SESDKBridge",
|
||
|
"asyncFetchRemoteConfigFun",
|
||
|
JSON.stringify(myObject)
|
||
|
);
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _asyncFetchRemoteConfig_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
_asyncFetchRemoteConfig_wx: function (key) {
|
||
|
try {
|
||
|
var _key = UTF8ToString(key);
|
||
|
|
||
|
GameGlobal.SESDK.asyncFetchRemoteConfig(_key).then(function (value) {
|
||
|
var myObject = {
|
||
|
key: _key,
|
||
|
value: value.toString(),
|
||
|
};
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"weixin _asyncFetchRemoteConfig",
|
||
|
" key:",
|
||
|
_key,
|
||
|
" value:",
|
||
|
JSON.stringify(myObject)
|
||
|
);
|
||
|
SendMessage(
|
||
|
"SESDKBridge",
|
||
|
"asyncFetchRemoteConfigFun",
|
||
|
JSON.stringify(myObject)
|
||
|
);
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _asyncFetchRemoteConfig_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setVisitorId_dy: function (visitorId) {
|
||
|
try {
|
||
|
var _visitorId = UTF8ToString(visitorId);
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyinsetVisitorId :", " visitorId:", _visitorId);
|
||
|
globalThis.SESDK.setVisitorId(_visitorId);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setVisitorId_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
_setVisitorId_wx: function (visitorId) {
|
||
|
try {
|
||
|
var _visitorId = UTF8ToString(visitorId);
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixinsetVisitorId :", " visitorId:", _visitorId);
|
||
|
GameGlobal.SESDK.setVisitorId(_visitorId);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setVisitorId_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_getVisitorId_dy: function () {
|
||
|
try {
|
||
|
var visitorId = "unknown";
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_getVisitorId");
|
||
|
visitorId = globalThis.SESDK.getVisitorId();
|
||
|
|
||
|
if (typeof visitorId !== "string") {
|
||
|
console.log("Invalid _getVisitorId value in the returned object");
|
||
|
visitorId = "unknown";
|
||
|
}
|
||
|
|
||
|
var bufferSize = lengthBytesUTF8(visitorId) + 1;
|
||
|
var buffer = _malloc(bufferSize);
|
||
|
stringToUTF8(visitorId, buffer, bufferSize);
|
||
|
return buffer;
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getVisitorId_dy:", error);
|
||
|
return null;
|
||
|
}
|
||
|
},
|
||
|
_getVisitorId_wx: function () {
|
||
|
try {
|
||
|
var visitorId = "unknown";
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_getVisitorId");
|
||
|
visitorId = GameGlobal.SESDK.getVisitorId();
|
||
|
|
||
|
if (typeof visitorId !== "string") {
|
||
|
console.log("Invalid _getVisitorId value in the returned object");
|
||
|
visitorId = "unknown";
|
||
|
}
|
||
|
|
||
|
var bufferSize = lengthBytesUTF8(visitorId) + 1;
|
||
|
var buffer = _malloc(bufferSize);
|
||
|
stringToUTF8(visitorId, buffer, bufferSize);
|
||
|
return buffer;
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getVisitorId_wx:", error);
|
||
|
return null;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_login_dy: function (accountId) {
|
||
|
try {
|
||
|
var _accountId = UTF8ToString(accountId);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_login :", " accountId:", _accountId);
|
||
|
globalThis.SESDK.login(_accountId);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _login_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
_login_wx: function (accountId) {
|
||
|
try {
|
||
|
var _accountId = UTF8ToString(accountId);
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_login :", " accountId:", _accountId);
|
||
|
GameGlobal.SESDK.login(_accountId);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _login_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_getAccountId_dy: function () {
|
||
|
try {
|
||
|
var accountId = "unknow";
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_getAccountId");
|
||
|
accountId = globalThis.SESDK.getAccountId();
|
||
|
|
||
|
if (typeof accountId !== "string") {
|
||
|
console.log("Invalid _getAccountId value in the returned object");
|
||
|
accountId = "unknow";
|
||
|
}
|
||
|
|
||
|
var bufferSize = lengthBytesUTF8(accountId) + 1;
|
||
|
var buffer = _malloc(bufferSize);
|
||
|
stringToUTF8(accountId, buffer, bufferSize);
|
||
|
return buffer;
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getAccountId_dy:", error);
|
||
|
return null;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_getAccountId_wx: function () {
|
||
|
try {
|
||
|
var accountId = "unknow";
|
||
|
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_getAccountId");
|
||
|
accountId = GameGlobal.SESDK.getAccountId();
|
||
|
|
||
|
if (typeof accountId !== "string") {
|
||
|
console.log("Invalid _getAccountId value in the returned object");
|
||
|
accountId = "unknow";
|
||
|
}
|
||
|
|
||
|
var bufferSize = lengthBytesUTF8(accountId) + 1;
|
||
|
var buffer = _malloc(bufferSize);
|
||
|
stringToUTF8(accountId, buffer, bufferSize);
|
||
|
return buffer;
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getAccountId_wx:", error);
|
||
|
return null;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_logout_dy: function () {
|
||
|
try {
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("douyin_logout");
|
||
|
|
||
|
globalThis.SESDK.logout();
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _logout_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_logout_wx: function () {
|
||
|
try {
|
||
|
if (typeof _isdebug !== "undefined" && _isdebug)
|
||
|
console.log("weixin_logout");
|
||
|
|
||
|
GameGlobal.SESDK.logout();
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _logout_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setSuperProperties_dy: function (propertiesJson) {
|
||
|
try {
|
||
|
var _propertiesJson = UTF8ToString(propertiesJson);
|
||
|
var jsonObject = {};
|
||
|
if (_propertiesJson!= "") jsonObject = JSON.parse(_propertiesJson);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_setSuperProperties :", " propertiesJson:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.setSuperProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setSuperProperties_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setSuperProperties_wx: function (propertiesJson) {
|
||
|
try {
|
||
|
var _propertiesJson = UTF8ToString(propertiesJson);
|
||
|
var jsonObject = {};
|
||
|
if (_propertiesJson!= "") jsonObject = JSON.parse(_propertiesJson);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_setSuperProperties :", " propertiesJson:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.setSuperProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setSuperProperties_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_unsetSuperProperty_dy: function (key) {
|
||
|
try {
|
||
|
var _key = UTF8ToString(key);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_unsetSuperProperty :", " key:", _key);
|
||
|
|
||
|
globalThis.SESDK.unsetSuperProperty(_key);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _unsetSuperProperty_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_unsetSuperProperty_wx: function (key) {
|
||
|
try {
|
||
|
var _key = UTF8ToString(key);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_unsetSuperProperty :", " key:", _key);
|
||
|
|
||
|
GameGlobal.SESDK.unsetSuperProperty(_key);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _unsetSuperProperty_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_clearSuperProperties_dy: function () {
|
||
|
try {
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_clearSuperProperties");
|
||
|
|
||
|
globalThis.SESDK.clearSuperProperties();
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _clearSuperProperties_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_clearSuperProperties_wx: function () {
|
||
|
try {
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_clearSuperProperties");
|
||
|
|
||
|
GameGlobal.SESDK.clearSuperProperties();
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _clearSuperProperties_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_setPresetEvent_dy: function (eventType, properties) {
|
||
|
try {
|
||
|
var _eventType = UTF8ToString(eventType);
|
||
|
var _properties = UTF8ToString(properties);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_setPresetEvent :", " eventType:", _eventType, "properties:", _properties);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_properties!= "") jsonObject = JSON.parse(_properties);
|
||
|
|
||
|
globalThis.SESDK.setPresetEvent(_eventType, jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setPresetEvent_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setPresetEvent_wx: function (eventType, properties) {
|
||
|
try {
|
||
|
var _eventType = UTF8ToString(eventType);
|
||
|
var _properties = UTF8ToString(properties);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_setPresetEvent :", " eventType:", _eventType, "properties:", _properties);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_properties!= "") jsonObject = JSON.parse(_properties);
|
||
|
|
||
|
GameGlobal.SESDK.setPresetEvent(_eventType, jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setPresetEvent_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_setChannel_dy: function (channel) {
|
||
|
try {
|
||
|
var _channel = UTF8ToString(channel);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_setChannel :", " channel:", _channel);
|
||
|
|
||
|
globalThis.SESDK.setChannel(_channel);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setChannel_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setChannel_wx: function (channel) {
|
||
|
try {
|
||
|
var _channel = UTF8ToString(channel);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_setChannel :", " channel:", _channel);
|
||
|
|
||
|
GameGlobal.SESDK.setChannel(_channel);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setChannel_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_setReferrerTitle_dy: function (referrer_title) {
|
||
|
try {
|
||
|
var _referrer_title = UTF8ToString(referrer_title);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_setReferrerTitle :", " referrer_title:", _referrer_title);
|
||
|
|
||
|
globalThis.SESDK.setReferrerTitle(_referrer_title);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setReferrerTitle_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setReferrerTitle_wx: function (referrer_title) {
|
||
|
try {
|
||
|
var _referrer_title = UTF8ToString(referrer_title);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_setReferrerTitle :", " referrer_title:", _referrer_title);
|
||
|
|
||
|
GameGlobal.SESDK.setReferrerTitle(_referrer_title);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setReferrerTitle_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_setXcxPageTitle_dy: function (page_title) {
|
||
|
try {
|
||
|
var _page_title = UTF8ToString(page_title);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_setXcxPageTitle :", " page_title:", _page_title);
|
||
|
|
||
|
globalThis.SESDK.setXcxPageTitle(_page_title);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setXcxPageTitle_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setXcxPageTitle_wx: function (page_title) {
|
||
|
try {
|
||
|
var _page_title = UTF8ToString(page_title);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_setXcxPageTitle :", " page_title:", _page_title);
|
||
|
|
||
|
GameGlobal.SESDK.setXcxPageTitle(_page_title);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setXcxPageTitle_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackAdImpression_dy: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_trackAdImpression :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
globalThis.SESDK.trackAdImpression(jsonObject||{});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackAdImpression_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackAdImpression_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackAdImpression :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
GameGlobal.SESDK.trackAdImpression(jsonObject||{});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackAdImpression_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackAdClick_dy: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_trackAdClick :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
globalThis.SESDK.trackAdClick(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackAdClick_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackAdClick_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackAdClick :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
GameGlobal.SESDK.trackAdClick(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackAdClick_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackIAP_dy: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_trackIAP :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
globalThis.SESDK.trackIAP(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackIAP_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackIAP_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackIAP :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
GameGlobal.SESDK.trackIAP(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackIAP_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackAppAttr_dy: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_trackAppAttr :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
globalThis.SESDK.trackAppAttr(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackAppAttr_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackAppAttr_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackAppAttr :", " data:", _data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
GameGlobal.SESDK.trackAppAttr(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackAppAttr_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackOrder_dy: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_trackOrder :", " data:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.trackOrder(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackOrder_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackOrder_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackOrder :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackOrder(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackOrder_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackRegister_dy: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_trackRegister :", " data:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.trackRegister(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackRegister_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackRegister_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackRegister :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackRegister(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackRegister_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackLogin_dy: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_trackLogin :", " data:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.trackLogin(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackLogin_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackLogin_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackLogin :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackLogin(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackLogin_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
|
||
|
|
||
|
_trackReActive_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackReActive :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackReActive(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackReActive_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackAddToWishlist_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackAddToWishlist :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackAddToWishlist(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackAddToWishlist_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_trackShare_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackShare :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackShare(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackShare_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackCreateRole_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackCreateRole :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackCreateRole(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackCreateRole_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
|
||
|
_trackTutorialFinish_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackTutorialFinish :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackTutorialFinish(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackTutorialFinish_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackUpdateLevel_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackUpdateLevel :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackUpdateLevel(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackUpdateLevel_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
|
||
|
_trackViewContentMall_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackViewContentActivity :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackViewContentMall(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackViewContentMall_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_trackViewContentActivity_wx: function (data) {
|
||
|
try {
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_trackViewContentMall :", " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.trackViewContentActivity(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _trackViewContentActivity_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
_track_dy: function (eventName, data) {
|
||
|
try {
|
||
|
var _eventName = UTF8ToString(eventName);
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_track :", " eventName:", _eventName, " data:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.track(_eventName, jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _track_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_track_wx: function (eventName, data) {
|
||
|
try {
|
||
|
var _eventName = UTF8ToString(eventName);
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_track :", " eventName:", _eventName, " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.track(_eventName, jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _track_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_eventStart_dy: function (eventName) {
|
||
|
try {
|
||
|
var _eventName = UTF8ToString(eventName);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_eventstart :", " eventName:", _eventName);
|
||
|
|
||
|
globalThis.SESDK.eventStart(_eventName);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _eventStart_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_eventStart_wx: function (eventName) {
|
||
|
try {
|
||
|
var _eventName = UTF8ToString(eventName);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_eventstart :", " eventName:", _eventName);
|
||
|
|
||
|
GameGlobal.SESDK.eventStart(_eventName);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _eventStart_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_eventFinish_dy: function (eventName, data) {
|
||
|
try {
|
||
|
var _eventName = UTF8ToString(eventName);
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_eventFinish :", " eventName:", _eventName, " data:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.eventFinish(_eventName, jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _eventFinish_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_eventFinish_wx: function (eventName, data) {
|
||
|
try {
|
||
|
var _eventName = UTF8ToString(eventName);
|
||
|
var _data = UTF8ToString(data);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_data!= "") jsonObject = JSON.parse(_data);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_eventFinish :", " eventName:", _eventName, " data:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.eventFinish(_eventName, jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _eventFinish_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_userInit_dy: function (userdata) {
|
||
|
try {
|
||
|
var _userdata = UTF8ToString(userdata);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userdata!= "") jsonObject = JSON.parse(_userdata);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_userInit :", " userdata:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.userInit(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userInit_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_userInit_wx: function (userdata) {
|
||
|
try {
|
||
|
var _userdata = UTF8ToString(userdata);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userdata!= "") jsonObject = JSON.parse(_userdata);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_userInit :", " userdata:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.userInit(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userInit_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_userUpdate_dy: function (Update) {
|
||
|
try {
|
||
|
var _Update = UTF8ToString(Update);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_Update!= "") jsonObject = JSON.parse(_Update);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_userUpdate :", " userkey:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.userUpdate(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userUpdate_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_userUpdate_wx: function (Update) {
|
||
|
try {
|
||
|
var _Update = UTF8ToString(Update);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_Update!= "") jsonObject = JSON.parse(_Update);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_userUpdate :", " userkey:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.userUpdate(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userUpdate_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_userAdd_dy: function (userAdd) {
|
||
|
try {
|
||
|
var _userAdd = UTF8ToString(userAdd);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userAdd!= "") jsonObject = JSON.parse(_userAdd);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_userAdd :", " userAdd:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.userAdd(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userAdd_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_userAdd_wx: function (userAdd) {
|
||
|
try {
|
||
|
var _userAdd = UTF8ToString(userAdd);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userAdd!= "") jsonObject = JSON.parse(_userAdd);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_userAdd :", " userAdd:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.userAdd(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userAdd_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_userAppend_dy: function(userAppend) {
|
||
|
try {
|
||
|
var _userAppend = UTF8ToString(userAppend);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userAppend!= "") jsonObject = JSON.parse(_userAppend);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_userAppend :", " userAppend:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.userAppend(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userAppend_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_userAppend_wx: function(userAppend) {
|
||
|
try {
|
||
|
var _userAppend = UTF8ToString(userAppend);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userAppend!= "") jsonObject = JSON.parse(_userAppend);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_userAppend :", " userAppend:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.userAppend(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userAppend_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_userUnset_dy: function(userUnset) {
|
||
|
try {
|
||
|
var _userUnset = UTF8ToString(userUnset);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userUnset!= "") jsonObject = JSON.parse(_userUnset);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_userUnset :", " userUnset:", jsonObject);
|
||
|
|
||
|
globalThis.SESDK.userUnset(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userUnset_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_userUnset_wx: function(userUnset) {
|
||
|
try {
|
||
|
var _userUnset = UTF8ToString(userUnset);
|
||
|
|
||
|
var jsonObject = {};
|
||
|
if (_userUnset!= "") jsonObject = JSON.parse(_userUnset);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_userUnset :", " userUnset:", jsonObject);
|
||
|
|
||
|
GameGlobal.SESDK.userUnset(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userUnset_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_userDelete_dy: function(deleteType) {
|
||
|
try {
|
||
|
var _deleteType = UTF8ToString(deleteType);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin_userDelete :", " deleteType:", _deleteType);
|
||
|
|
||
|
globalThis.SESDK.userDelete(_deleteType);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userDelete_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_userDelete_wx: function(deleteType) {
|
||
|
try {
|
||
|
var _deleteType = UTF8ToString(deleteType);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin_userDelete :", " deleteType:", _deleteType);
|
||
|
|
||
|
GameGlobal.SESDK.userDelete(_deleteType);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _userDelete_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_setOnAttributionListener_dy: function () {
|
||
|
try {
|
||
|
globalThis.SESDK.setOnAttributionListener().then(function(result) {
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"douyin _setOnAttributionListener",
|
||
|
JSON.stringify(result)
|
||
|
);
|
||
|
SendMessage(
|
||
|
"SESDKBridge",
|
||
|
"setOnAttributionListenerFun",
|
||
|
JSON.stringify(result)
|
||
|
);
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log(
|
||
|
"An error occurred in _setOnAttributionListener_dy:",
|
||
|
error
|
||
|
);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setOnAttributionListener_wx: function () {
|
||
|
try {
|
||
|
GameGlobal.SESDK.setOnAttributionListener().then(function(result) {
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"weixin _setOnAttributionListener",
|
||
|
JSON.stringify(result)
|
||
|
);
|
||
|
SendMessage(
|
||
|
"SESDKBridge",
|
||
|
"setOnAttributionListenerFun",
|
||
|
JSON.stringify(result)
|
||
|
);
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log(
|
||
|
"An error occurred in _setOnAttributionListener_wx:",
|
||
|
error
|
||
|
);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_getAttribution_dy: function () {
|
||
|
try {
|
||
|
globalThis.SESDK.getAttribution().then(function(result) {
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin _getAttribution", JSON.stringify(result));
|
||
|
SendMessage("SESDKBridge", "getAttributionFun", JSON.stringify(result));
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getAttribution_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_getAttribution_wx: function () {
|
||
|
try {
|
||
|
GameGlobal.SESDK.getAttribution().then(function(result) {
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin _getAttribution", JSON.stringify(result));
|
||
|
SendMessage("SESDKBridge", "getAttributionFun", JSON.stringify(result));
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getAttribution_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
_setPluginProperties_dy: function (paramJson) {
|
||
|
try {
|
||
|
var _paramJson = UTF8ToString(paramJson);
|
||
|
var jsonObject = {};
|
||
|
if (_paramJson!= "") jsonObject = JSON.parse(_paramJson);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"douyin_setPluginProperties :",
|
||
|
" paramJson:",
|
||
|
_paramJson
|
||
|
);
|
||
|
globalThis.SESDK.setPluginProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setPluginProperties_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_setPluginProperties_wx: function (paramJson) {
|
||
|
try {
|
||
|
var _paramJson = UTF8ToString(paramJson);
|
||
|
var jsonObject = {};
|
||
|
if (_paramJson!= "") jsonObject = JSON.parse(_paramJson);
|
||
|
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log(
|
||
|
"weixin_setPluginProperties :",
|
||
|
" paramJson:",
|
||
|
_paramJson
|
||
|
);
|
||
|
GameGlobal.SESDK.setPluginProperties(jsonObject);
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _setPluginProperties_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_getDistinct_dy: function () {
|
||
|
try {
|
||
|
var distinct = "unknown";
|
||
|
|
||
|
globalThis.SESDK.getDistinct().then(function(data) {
|
||
|
distinct = JSON.stringify(data.result);
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("douyin _getDistinct ", distinct);
|
||
|
|
||
|
SendMessage('SESDKBridge', 'getDistinctFun', distinct);
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getDistinct_dy:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
_getDistinct_wx: function () {
|
||
|
try {
|
||
|
var distinct = "unknown";
|
||
|
|
||
|
GameGlobal.SESDK.getDistinct().then(function(data) {
|
||
|
distinct = JSON.stringify(data.result);
|
||
|
if (typeof _isdebug!== "undefined" && _isdebug)
|
||
|
console.log("weixin _getDistinct ", distinct);
|
||
|
|
||
|
SendMessage('SESDKBridge', 'getDistinctFun', distinct);
|
||
|
});
|
||
|
} catch (error) {
|
||
|
console.log("An error occurred in _getDistinct_wx:", error);
|
||
|
}
|
||
|
},
|
||
|
|
||
|
|
||
|
});
|
||
|
|