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#if DEBUG
22  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"];
23#else
24  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
25#endif
26}
27
28// Linking API
29- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
30  return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];
31}
32
33// Universal Links
34- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
35  BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
36  return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result;
37}
38
39// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
40- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
41{
42  return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
43}
44
45// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
46- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
47{
48  return [super application:application didFailToRegisterForRemoteNotificationsWithError:error];
49}
50
51// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
52- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
53{
54  return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
55}
56
57@end
58