wx.getLaunchOptionsSync,每天新增有一半用户获取不到渠道信息?
发布于 5 年前 作者 ming59 3831 次浏览 来自 官方Issues
/**
     *
     * [@param](/user/param) index 获取小游戏端渠道号
     */
    export function getWxChannel() {
        let options = wx.getLaunchOptionsSync();
        let channel;
        if (options != undefined) {
            wx.aldSendEvent(`启动参数:` + JSON.stringify(options))
            if (options['query'] && options['query'].channel) {
                channel = options['query'].channel;
            } else if (options['extraData'] && options['extraData'].channel) {
                channel = options['extraData'].channel;
            } else if (options['referrerInfo'] && options['referrerInfo']['extraData'] && options['referrerInfo']['extraData'].channel) {
                channel = options['referrerInfo']['extraData'].channel;
            } else {
                channel = -1;
            }
        } else {
            channel = -1;
        }
        return channel;
    }

通过wx.getLaunchOptionsSync获取投放广告时配置的渠道信息,现在每天都有一半的用户获取不到渠道信息。

麻烦官方大大们帮我看看。

1 回复

是什么意思?看下报错信息是什么呢

回到顶部