URLscheme的query键ticket更新为t之后在安卓微信环境下不能直接唤起小程序
发布于 5 年前 作者 tao80 478 次浏览 来自 问答

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/url-scheme.html

https://developers.weixin.qq.com/community/develop/doc/00060aa283430885398b44a7c5d001?highLine=scheme

公告更新之后,【安卓微信】环境下,location.href=

weixin://dl/business/?ticket=xxxxxx 可以跳转

weixin://dl/business/?t=xxxxxx 不可以跳转

在【IOS微信】和普通浏览器表现正常

--------------------------

复现例子:

A组:将https://z.didi.cn/4dCYq 地址发送微信好友之后。好友点击之后,自动打开小程序(橙心)。

中间页 使用参数为ticket方式可以自动打开。

地址分析

1.短链 https://z.didi.cn/4dCYq

2.对应长链 https://page.xiaojukeji.com/package/MPURLShemeSDK/wxmp-302.html?redirect=weixin%3a%2f%2fdl%2fbusiness%2f%3fticket%3dl9e17b37da6fb39d17c74432306f095bb

3.对应scheme为 weixin://dl/business/?ticket=l9e17b37da6fb39d17c74432306f095bb


B组:将https://z.didi.cn/4CjPJ 地址发送微信好友之后。好友点击之后,不可以打开小程序(公交)。

中间页使用参数为t方式可以,不能自动打开。

地址分析

1.短链 https://z.didi.cn/4CjPJ

2.对应长链 https://page.xiaojukeji.com/package/MPURLShemeSDK/wxmp-302.html?redirect=weixin%3A%2F%2Fdl%2Fbusiness%2F%3Ft%3DmgJpFA4LVxe

3.对应scheme为 weixin://dl/business/?t=mgJpFA4LVxe

--------------------------


中间页html代码


  中间页

  正在打开滴滴公交小程序...

打开小程序

    function getQueryString(name) {
      var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
      var r = window.location.search.substr(1).match(reg);
      if (r != null) {
        return unescape(r[2]);
      }
      return null;
    }
    function jump() {
      var href = decodeURIComponent(getQueryString('redirect'));
      window.location.href=href
    }

    function go2page() {
      jump()
    }

    window.onload = function () {
      jump()
    }

  






3 回复

这个改了?

回到顶部