@norcy/react-native-toolkit 0.1.128 → 0.1.129
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.
@@ -21,8 +21,20 @@
|
|
21
21
|
|
22
22
|
- (BOOL)hook_openURL:(NSURL *)url
|
23
23
|
{
|
24
|
-
|
25
|
-
|
24
|
+
if (!url) {
|
25
|
+
return NO;
|
26
|
+
}
|
27
|
+
|
28
|
+
__block BOOL result = NO;
|
29
|
+
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
30
|
+
|
31
|
+
[self openURL:url options:@{} completionHandler:^(BOOL success) {
|
32
|
+
result = success;
|
33
|
+
dispatch_semaphore_signal(semaphore);
|
34
|
+
}];
|
35
|
+
|
36
|
+
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0 * NSEC_PER_SEC)));
|
37
|
+
return result;
|
26
38
|
}
|
27
39
|
|
28
40
|
@end
|