@volcengine/react-native-live-pull 1.5.2-rc.1 → 1.5.2-rc.2

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.
@@ -32,8 +32,17 @@
32
32
  }
33
33
 
34
34
  - (NSDictionary *)callApiSync:(NSDictionary *)args {
35
- [self newApiEngine];
36
- return [self.volcApiEngine callApi:args];
35
+ __block NSDictionary *result = nil;
36
+ void (^work)(void) = ^{
37
+ [self newApiEngine];
38
+ result = [self.volcApiEngine callApi:args];
39
+ };
40
+ if ([NSThread isMainThread]) {
41
+ work();
42
+ } else {
43
+ dispatch_sync(dispatch_get_main_queue(), work);
44
+ }
45
+ return result;
37
46
  }
38
47
 
39
48
  //callback 是OC的回调函数,外层需要进一步封装,接收一个NSDictionary类型的参数
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/react-native-live-pull",
3
- "version": "1.5.2-rc.1",
3
+ "version": "1.5.2-rc.2",
4
4
  "peerDependencies": {
5
5
  "react": "*",
6
6
  "react-native": "*"