react-native-work-wechat
文档地址:https://developer.work.weixin.qq.com/document/path/91196
安装
$ npm install react-native-work-wechat --save
$ yarn add react-native-work-wechat
$ react-native link react-native-work-wechat
使用
import WorkWechat from 'react-native-work-wechat';
// 初始化
WorkWechat.init({
appId: string;
agentId: string;
schema: string;
appName: string;
}): boolean;
/**
* 分享文本
* @param str 内容
*/
WorkWechat.shareText(str: string): Promise<Result>;
/**
* 分享文件
* @param path 路径
* @param name 文件名称
*/
WorkWechat.shareFile(path: string, name ?: string): Promise<Result>;
/**
* 分享图片
* @param path 路径
* @param name 文件名称
*/
WorkWechat.shareImage(path: string, name ?: string): Promise<Result>;
/**
* 分享视频
* @param path 路径
* @param name 文件名称
*/
WorkWechat.shareVideo(path: string, name ?: string): Promise<Result>;
/**
* 分享网页
* @param params
*/
WorkWechat.shareWeb({
url: string;
title?: string;
image: string;
description?: string;
}): Promise<Result>;
/**
* 分享小程序
* @param params
*/
WorkWechat.shareMiniProgram({
appId: string;
path: string;
title?: string;
image: string;
description?: string;
env: number; // 0正式,1开发,2预览
}): Promise<Result>;
/**
* 是否安装企业微信
*/
WorkWechat.isInstalled(): boolean;