每次点击按钮跳转这个页面之后都重新返回app
// 微信
[WXApi registerApp:@"wx473be85963ea2337" universalLink:@"https://yunying.suizhu.net/wx_conn/"];
association是: applinks:yunying.suizhu.net
//进入小程序
WXLaunchMiniProgramReq *mini = [WXLaunchMiniProgramReq object]; mini.userName = @“gh_0e73c1472d5f”; //拉起的小程序的username,gh_0e73c1472d5f mini.path = @"/pages/home/home?info=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODcwMTk3MjgsImlhdCI6MTY4NTcwNTcyOCwiZGF0YSI6eyJwcm9qZWN0X2lkIjoyNTQ4LCJvcmdfaWQiOjIsInVzZXJfaWQiOjEyODN9fQ.8zp2F1bdhPEq8Z6DQP6W0XPRQE1hacyEf-NAJqHENfg"; mini.miniProgramType = 0; //拉起小程序的类型 [WXApi sendReq:mini completion:^(BOOL success) { }];
回调:
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
return [WXApi handleOpenUniversalLink:userActivity delegate:self];;
}