API兼容性:
QRN:v3.21.0
iOS: 80011201
Android:60001305
QMiniProgram
打开小程序 api
import { QMiniProgram } from 'qunar-react-native';
QMiniProgram.launchMiniProgram(param: object, callback: function)
输入小程序所需参数,打开小程序
param = {
userName: 'gh_xxxxxxxxxxxx', // 小程序应用 id 必传
path: 'main/', // 小程序页面路径
miniprogramType: 1 //1 (开发版)2(体验版)0(线上版)
}
callbackResponse = {
ret: 1, // 返回码,1 为成功,0为失败
des: 'xxxx' //描述, ret 为 1 时无描述
}
import { QMiniProgram } from "qunar-react-native";
// 获取最近的一个定位结果
let userName = 'gh_xxxxxxxxx';
let path = 'main/xxxx/xxx/';
let miniprogramType = '0';
QMiniProgram.launchMiniProgram({userName, path, userIdToken, source, miniprogramType}, (response) => {
alert(JSON.stringify(response));
})