从经过微信认证的 App 跳转
... 2026-1-26 小于 1 分钟
# 从经过微信认证的 App 跳转
使用该功能需要申请微信认证,接入微信 SDK,并参考微信开放平台 SDK 拉起小程序功能 (opens new window)的文档进行跳转(由于 QQ 互联平台的限制,暂不支持非腾讯官方应用跳转腾讯文档 QQ 小程序,内部使用请咨询相关负责人员)。
腾讯文档微信小程序的原始 ID 为 : gh_252c5f06840b。
代码示例(Android,以打开本篇文档为例,其他 path 请参见后续文档):
String appId = "填写您的移动应用的 APPID";
WXAPI api = WXAPIFactory.createWXAPI(context, appId);
WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
req.userName = "gh_252c5f06840b";
req.path = "pages/detail/detail?url=" + URLEncoder.encode("https://docs.qq.com/doc/DVmtlZUVtVGxQZFp3");
req.miniprogramType = WXLaunchMiniProgram.Req.MINIPROGRAM_TYPE_RELEASE;
api.sendReq(req);
1
2
3
4
5
6
7
2
3
4
5
6
7
1
2
3
4
5
6
7
2
3
4
5
6
7
代码示例(iOS,以打开本篇文档为例,其他 path 请参见后续文档):
NSString *url = @"https://docs.qq.com/doc/DVmtlZUVtVGxQZFp3";
NSString *escapedUrl = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]];
WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object];
launchMiniProgramReq.userName = @"gh_252c5f06840b";
launchMiniProgramReq.path = [NSString stringWithFormat:@"pages/detail/detail?url=%@", escapedUrl];
launchMiniProgramReq.miniProgramType = WXMiniProgramTypeRelease;
[WXApi sendReq:launchMiniProgramReq];
1
2
3
4
5
6
7
2
3
4
5
6
7
1
2
3
4
5
6
7
2
3
4
5
6
7