APP跳微信小程序并传参数,话不多说直接上代码:
//拼接参数,这样评价小程序可以拿到对应的参数
NSString *path = [NSString stringWithFormat:@"%@?code=%@&m=%@",self.wx_path,self.wx_code,self.likeTF.text];
WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object];
//拉起的小程序的原始ID,需要申请获取
launchMiniProgramReq.userName = self.wx_id;
//拉起小程序页面的可带参路径,不填默认拉起小程序首页
launchMiniProgramReq.path = path;
//拉起小程序的类型
launchMiniProgramReq.miniProgramType = WXMiniProgramTypeRelease;
[WXApi sendReq:launchMiniProgramReq completion:nil];
END.