123456789101112131415161718192021222324252627 |
- import * as WeChat from "react-native-wechat";
- /**
- public static String WX_APPID = "wx51acc19c8f7a0f6f";
- public static String WX_SECRET = "e830d45f497025041269ef6221140c3d";
- */
- WeChat.registerApp("wx51acc19c8f7a0f6f");
- export default class wechat {
- componentWillMount() {}
- //文字好友分享
- static shareToSession(text, description) {
- console.log("123123123123123");
- WeChat.isWXAppInstalled().then(isInstalled => {
- if (isInstalled) {
- WeChat.shareToSession({
- type: "text",
- description: "测试微信好友分享的文本内容"
- }).catch(error => {
- console.log(error.message);
- });
- } else {
- alert("请安装微信");
- }
- });
- }
- }
|