提交 be7e705a 作者: 王进

更新内容:1. SDK上报增加network_type字段

          2. 暴露getNetworkType接口
上级 0c42b935
/** /**
* 鲸鱼游戏微信小游戏接入库 * 鲸鱼游戏微信小游戏接入库
* @author 推广技术部 * @author 推广技术部
* @time: 2020-07-10 * @time: 2020-07-16
* 更新内容:1. 米大师返回异常值更新 * 更新内容:1. SDK上报增加network_type字段
* 2. 暴露getNetworkType接口
*/ */
class WechatSDK { class WechatSDK {
private sdkVersion: string = '2.5.4' private sdkVersion: string = '2.5.4'
...@@ -501,14 +502,16 @@ class WechatSDK { ...@@ -501,14 +502,16 @@ class WechatSDK {
public getLaunchOptions() { public getLaunchOptions() {
return (wx as any).getLaunchOptionsSync() return (wx as any).getLaunchOptionsSync()
} }
private async getNetworkType() { public async getNetworkType() {
const _selt = this const _selt = this
await (wx as any).getNetworkType({ await (wx as any).getNetworkType({
success: (res) => { success: (res) => {
_selt.ReportParams.networkType = _selt.heartParams.info.network = res.networkType _selt.ReportParams.networkType = _selt.heartParams.info.network = _selt.sdkParams.network_type = res.networkType
return res.networkType;
}, },
fail: (err) => { fail: (err) => {
console.log("--SDK错误->getNetworkType", err) console.log("--SDK错误->getNetworkType", err)
return '';
} }
}) })
} }
...@@ -1184,6 +1187,7 @@ class WechatSDK { ...@@ -1184,6 +1187,7 @@ class WechatSDK {
from_openid: '', // 跳转前小游戏的用户openid from_openid: '', // 跳转前小游戏的用户openid
from_product: '', // 跳转前小游戏对接的产品CODE from_product: '', // 跳转前小游戏对接的产品CODE
from_uid: '', // 跳转前小游戏登录的SDK用户UID from_uid: '', // 跳转前小游戏登录的SDK用户UID
network_type: '', // 用户当前网络类型
} }
} }
// SDK后端接口(勿改) // SDK后端接口(勿改)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论