2022-05-08 22:35:43 +02:00
|
|
|
#import "AppDelegate.h"
|
|
|
|
|
|
|
|
#import <React/RCTBundleURLProvider.h>
|
|
|
|
|
|
|
|
#import <React/RCTLinkingManager.h>
|
|
|
|
#import <RNShareMenu/ShareMenuManager.h>
|
|
|
|
|
|
|
|
@implementation AppDelegate
|
|
|
|
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
|
|
{
|
2023-02-11 19:15:34 +01:00
|
|
|
self.moduleName = @"main";
|
|
|
|
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
2022-08-06 22:05:26 +02:00
|
|
|
}
|
|
|
|
|
2022-05-08 22:35:43 +02:00
|
|
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
|
|
{
|
|
|
|
#if DEBUG
|
|
|
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
|
|
#else
|
|
|
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2023-02-11 19:15:34 +01:00
|
|
|
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
|
|
|
|
///
|
|
|
|
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
|
|
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
|
|
|
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
|
|
|
|
- (BOOL)concurrentRootEnabled
|
2022-05-08 22:35:43 +02:00
|
|
|
{
|
2023-02-11 19:15:34 +01:00
|
|
|
return true;
|
2022-05-08 22:35:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Linking API
|
|
|
|
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
|
|
|
|
NSString *urlString = url.absoluteString;
|
|
|
|
|
|
|
|
if ([urlString hasPrefix:@"tooot-share://"]) {
|
|
|
|
NSLog(@"Entered with the following string: %@s", urlString);
|
|
|
|
return [ShareMenuManager application:application openURL:url options:options];
|
|
|
|
}
|
|
|
|
|
|
|
|
return [RCTLinkingManager application:application openURL:url options:options];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Universal Links
|
|
|
|
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
|
|
|
|
return [RCTLinkingManager application:application
|
|
|
|
continueUserActivity:userActivity
|
|
|
|
restorationHandler:restorationHandler];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|