@volcengine/react-native-live-push 1.5.2-rc.0 → 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.
@@ -36,8 +36,17 @@
36
36
  }
37
37
 
38
38
  - (NSDictionary *)callApiSync:(NSDictionary *)args {
39
- [self newApiEngine];
40
- return [self.volcApiEngine callApi:args];
39
+ __block NSDictionary *result = nil;
40
+ void (^work)(void) = ^{
41
+ [self newApiEngine];
42
+ result = [self.volcApiEngine callApi:args];
43
+ };
44
+ if ([NSThread isMainThread]) {
45
+ work();
46
+ } else {
47
+ dispatch_sync(dispatch_get_main_queue(), work);
48
+ }
49
+ return result;
41
50
  }
42
51
 
43
52
  - (void)callApi:(NSDictionary *)args callback:(void (^)(id))callback {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/react-native-live-push",
3
- "version": "1.5.2-rc.0",
3
+ "version": "1.5.2-rc.2",
4
4
  "peerDependencies": {
5
5
  "react": "*",
6
6
  "react-native": "*"