Compare commits

...

2 Commits

Author SHA1 Message Date
snowfox
9231c7196f
Merge pull request #301 from 1275741406/fix_name_undefined
fix:android/ios registerApp of null & update README.md
2025-10-28 10:46:17 +08:00
--global
84000a32b6 fix:android/ios registerApp of null & update README.md 2025-10-22 13:49:40 +08:00
5 changed files with 10 additions and 11 deletions

View File

@ -1,7 +1,7 @@
<img height="200" src="./image/weixin.png?raw=true">
# React-Native-Wechat-Lib
![Version](https://img.shields.io/badge/Version-V3.0.0-brightgreen)
![Version](https://img.shields.io/badge/Version-V3.0.4-brightgreen)
![npm version](https://img.shields.io/badge/npm-v1.1.24-blue)
![Wechat SDK](https://img.shields.io/badge/WechatSDKAndroid-V6.8.20-brightgreen)
![Wechat SDK](https://img.shields.io/badge/WechatSDKIos-V2.0-brightgreen)
@ -36,7 +36,7 @@
目前最新代码版本为 3.0.x但 NPM Last 版本暂时只到 1.1.26,因为 **3.0.x 暂时还处于开发阶段**,有小部分功能**未经过测试**。
如果你需要使用 3.0.x 版本,请在 package.json 中加上版本号 react-native-wechat-lib@3.0.4,切换前请你清楚了解该版本的风险,该版本为开发版。
如果你需要使用 3.0.x 版本,请在 package.json 中加上版本号 **react-native-wechat-lib@3.0.4**,切换前请你清楚了解该版本的风险,该版本为开发版。
我会尽快推出 3.0.x 发行版。
@ -62,6 +62,9 @@
NPM 安装
```sh
npm install react-native-wechat-lib --save
# 3.0.x 使用3.0.4
npm install react-native-wechat-lib@3.0.4 --save
# 3.0.0 开始弃用
react-native link react-native-wechat-lib
```

View File

@ -120,7 +120,7 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
@Override
public String getName() {
return "RCTWeChat";
return "WeChat";
}
/**

View File

@ -24,7 +24,7 @@
#define RCTWXEventName @"WeChat_Resp"
#define RCTWXEventNameWeChatReq @"WeChat_Req"
@interface WechatLib : NSObject <RCTBridgeModule, WXApiDelegate>
@interface WeChat : NSObject <RCTBridgeModule, WXApiDelegate>
@property NSString* appId;

View File

@ -8,12 +8,12 @@
#import "WechatAuthSDK.h"
@interface WechatLib () <WechatAuthAPIDelegate>
@interface WeChat () <WechatAuthAPIDelegate>
@property (nonatomic, strong) WechatAuthSDK *authSDK;
@property (nonatomic, strong) RCTResponseSenderBlock scanCallback;
@end
@implementation WechatLib
@implementation WeChat
// Define error messages
#define NOT_REGISTERED (@"registerApp required.")

View File

@ -5,11 +5,7 @@ import { sha1 } from 'js-sha1';
import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform } from 'react-native';
let isAppRegistered = false;
let { WeChat, WechatLib } = NativeModules;
if (WeChat == null) {
WeChat = WechatLib;
}
let { WeChat } = NativeModules;
// Event emitter to dispatch request and response from WeChat.
const emitter = new EventEmitter();