-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (34 loc) · 1 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { DeviceEventEmitter,NativeModules } from 'react-native';
import { EventEmitter } from 'events';
const { RNApplets } = NativeModules;
const emitter = new EventEmitter();
DeviceEventEmitter.addListener('WeChat_Resp', resp => {
emitter.emit('wechat', resp);
});
/**
* 注册appid
* @method registerApp
* @param {String} appid
* @param {Callback} callback
*/
export const registerApp = RNApplets.registerApp
/**
* 打开小程序
* @method launchMini
* @param {userName:"小程序原始id",path:"拉起小程序页面的可带参路径",miniProgramType:0}--miniProgramType 拉起小程序的类型. 0-正式版 1-开发版 2-体验版
* @param {Callback} callback
*/
export const launchMini=RNApplets.launchMini
/**
* 是否注册appid
* @method isWXAppInstalled
* @param {Callback} callback
*/
export const isWXAppInstalled=RNApplets.isWXAppInstalled
/**
* 打开微信
* @method openWXApp
* @param {Callback} callback
*/
export const openWXApp = RNApplets.openWXApp
export default RNApplets;