|
1
|
#import "AppDelegate.h" |
|
2
|
|
|
3
|
#import <React/RCTBundleURLProvider.h> |
|
4
|
#import <React/RCTLinkingManager.h> |
|
5
|
|
|
6
|
@implementation AppDelegate |
|
7
|
|
|
8
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
|
9
|
{ |
|
10
|
self.moduleName = @"main"; |
|
11
|
|
|
12
|
// You can add your custom initial props in the dictionary below. |
|
13
|
// They will be passed down to the ViewController used by React Native. |
|
14
|
self.initialProps = @{}; |
|
15
|
|
|
16
|
return [super application:application didFinishLaunchingWithOptions:launchOptions]; |
|
17
|
} |
|
18
|
|
|
19
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge |
|
20
|
{ |
|
21
|
return [self bundleURL]; |
|
22
|
} |
|
23
|
|
|
24
|
- (NSURL *)bundleURL |
|
25
|
{ |
|
26
|
#if DEBUG |
|
27
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"]; |
|
28
|
#else |
|
29
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; |
|
30
|
#endif |
|
31
|
} |
|
32
|
|
|
33
|
// Linking API |
|
34
|
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { |
|
35
|
return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options]; |
|
36
|
} |
|
37
|
|
|
38
|
// Universal Links |
|
39
|
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { |
|
40
|
BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; |
|
41
|
return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result; |
|
42
|
} |
|
43
|
|
|
44
|
// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries |
|
45
|
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken |
|
46
|
{ |
|
47
|
return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; |
|
48
|
} |
|
49
|
|
|
50
|
// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries |
|
51
|
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error |
|
52
|
{ |
|
53
|
return [super application:application didFailToRegisterForRemoteNotificationsWithError:error]; |
|
54
|
} |
|
55
|
|
|
56
|
// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries |
|
57
|
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler |
|
58
|
{ |
|
59
|
return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; |
|
60
|
} |
|
61
|
|
|
62
|
@end |