根据这个 https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_H5_Launch_APP.html
我已成功配置 wx.config,并且H5上成功显示 “<wx-open-launch-app>" 按钮,点击按钮可以打开App,代码如下:
<wx-open-launch-app
id="launch-btn"
appid="wx4fc78bcc171981ff"
extinfo="请问H5页面上的参数怎么传给Universal link,然后再打开指定的页面?"
>
<script type="text/wxtag-template">
<style>.btn {padding: 22px; background-color:#C62849; font-size:25px; border-style: solid; color:#fff}</style>
<span class="btn">点击进入App</span>
</script>
</wx-open-launch-app>
extinfo 填写什么内容?怎么把内容传给UniversalLink,然后打开指定的页面?
Xcode的 AppDelegate.m file怎修改来接受extinfo的内容,然后传给Universal Link?
谢谢!
想问一下。你通过这套代码能拿到extinfo的值么。。我都进不到onreq里面。可否留个联系方式 想请教一下
文档上说格式自定义了,传的时候传字符串,打开什么页面app里面根据传参判断咯
//Wexin
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [WXApi handleOpenURL:url delegate:self];
}
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable
restorableObjects))restorationHandler {
// 触发回调方法
[RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
return [WXApi handleOpenUniversalLink:userActivity delegate:self];
}
// ios 9.0+
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
options:(NSDictionary<NSString*, id> *)options
{
// Triggers a callback event.
// 触发回调事件
[RCTLinkingManager application:application openURL:url options:options];
return [WXApi handleOpenURL:url delegate:self];
}