This is the third day of my participation in Gwen Challenge
Mobile app pull up applet function
Mobile APP pull-up mini program means that users can jump to a designated page of a wechat mini program through a third-party mobile APP (APP) with access to this function, and jump back to the original mobile APP (APP) after completing the service.
The function of pulling up small programs for mobile applications has been opened to all developers. Developers can obtain the permission of pulling up small programs for mobile applications after they apply for mobile applications under wechat open platform account and pass the review.
You can select Admin Center – Mobile Application – Application Details – Associated Applet Information to initiate associated applet operations for approved mobile applications.
Mobile applications and applets under the same open platform account can complete the jump without association. Applets under different open platform accounts can only support the jump after they are successfully associated with the mobile application (APP).
A mobile application can be bound to a maximum of three mini-programs at the same time, and can be bound three times a month. The same applet can be associated with 500 mobile apps.
Android Development Examples
Before development, you need to download the Android development kit (SDK) and follow the instructions in “Resource Center – Development Resources – Resources Download -Android Resources Download”.
Call interface: WXLaunchMiniProgram Mobile application jump to applet example:
String appId = “wxd930ea5d5a258f4f”; AppId IWXAPI API = wxapiFactory. createWXAPI(context, AppId);
WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req(); req.userName = "gh_d43f693ca31f"; // Fill in the original id req.path = path; / / pull a small program can take and path of the page, a thin application will not fill the default home page the req. MiniprogramType = WXLaunchMiniProgram. The req. MINIPTOGRAM_TYPE_RELEASE; SendReq (req); sendReq(req);Copy the code
The callback that
In the WXEntryActivity
public void onResp(BaseResp resp) { if (resp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) { WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) resp; String extraData =launchMiniProResp.extMsg; <button open-type="launchApp"> <button open-type="launchApp">Copy the code
IOS Development Examples
Before development, download the iOS development kit (SDK) and follow the instructions in the resource Center – Development Resources – Resources Download -iOS Resources Download.
Example of mobile app jump to applets:
WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object]; launchMiniProgramReq.userName = userName; / / pull small application username launchMiniProgramReq. Path = path; / / pull a small program can take and path of the page, a thin application will not fill the default home page launchMiniProgramReq. MiniProgramType = miniProgramType; / / pull a small program on the type of the return [WXApi sendReq: launchMiniProgramReq];Copy the code
The callback that
-(void)onResp:(BaseResp *)resp { if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]) { NSString *string = resp.extMsg; }}}Copy the code