短信H5链接通过urlscheme跳转微信小程序

1.已经发布的小程序。(未发布不可获取)

2.通过该小程序获取access_token。(access_token获取规则参照:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html

3.post请求接口 取得 openlink

 

 

POST /wxa/generatescheme?access_token=生成的access_token HTTP/1.1
Host: api.weixin.qq.com
Content-Type: application/json
Content-Length: 41

{"jump_wxa":{"path":"pages/index/index"}}

 

响应内容

{
    "errcode": 0,
    "errmsg": "ok",
    "openlink": "weixin://dl/business/?t=ABCDEFG"
}

具体参数参照:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html

4.编写页面跳转openlink的链接,需要注意的是必须有点击事件才能打开urlscheme.

 

 

posted @ 2021-01-20 15:53  零贰  阅读(3532)  评论(0编辑  收藏  举报