@gyjshow/react-native-wechat 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -125,7 +125,7 @@ const payParams = {
125
125
  };
126
126
 
127
127
  try {
128
- const result = await WeChat.pay(payParams);
128
+ const result = await WeChat.wxpay(payParams);
129
129
  console.log('Pay result:', result);
130
130
  } catch (error) {
131
131
  console.error('Pay failed:', error);
@@ -5,10 +5,38 @@
5
5
 
6
6
  RCT_EXPORT_MODULE();
7
7
 
8
- RCT_EXPORT_METHOD(registerApp:(NSString *)appId) {
9
- [WXApi registerApp:appId];
8
+ RCT_EXPORT_METHOD(registerApp:(NSString *)appId
9
+ resolver:(RCTPromiseResolveBlock)resolve
10
+ rejecter:(RCTPromiseRejectBlock)reject)
11
+ {
12
+
13
+ //在register之前打开log, 后续可以根据log排查问题
14
+ [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
15
+ NSLog(@"WeChatSDK: %@", log);
16
+ }];
17
+
18
+ NSString *universalLink =
19
+ [[NSBundle mainBundle] objectForInfoDictionaryKey:@"WeChatUniversalLink"];
20
+
21
+ if (universalLink.length == 0) {
22
+ reject(@"NO_UNIVERSAL_LINK",
23
+ @"WeChatUniversalLink not found in Info.plist",
24
+ nil);
25
+ return;
26
+ }
27
+
28
+ BOOL success = [WXApi registerApp:appId universalLink:universalLink];
29
+
30
+
31
+ //调用自检函数
32
+ [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
33
+ NSLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
34
+ }];
35
+
36
+ resolve(@(success));
10
37
  }
11
38
 
39
+
12
40
  RCT_EXPORT_METHOD(getVersion:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
13
41
  resolve([WXApi getApiVersion]);
14
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gyjshow/react-native-wechat",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "description": "待测试验证!!! React Native WeChat plugin for WeChat Pay and Share (iOS & Android)",
6
6
  "main": "lib/index.js",