Files
notesnook/apps/mobile/ios/Make Note/ShareViewController.m
Abdullah Atta 3de225f7c9 mobile: upgrade react native 0.82
this commit also bump app version to 3.3.10-beta.0
2025-11-27 11:32:50 +05:00

69 lines
1.8 KiB
Objective-C

#import <Foundation/Foundation.h>
#import <ReactNativeShareExtension.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLog.h>
#import <React/RCTEventEmitter.h>
#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>
#import <RCTAppDelegate.h>
@interface ReactNativeShareDelegate : RCTDefaultReactNativeFactoryDelegate
@end
@implementation ReactNativeShareDelegate
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [self bundleURL];
}
- (NSURL *)bundleURL
{
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
}
@end
@interface ShareViewController : ReactNativeShareExtension
@property (nonatomic, strong) RCTReactNativeFactory *reactNativeFactory;
@property (nonatomic, strong) ReactNativeShareDelegate *reactNativeDelegate;
@end
@implementation ShareViewController
@synthesize bridge = _bridge;
@synthesize callableJSModules = _callableJSModules;
+ (BOOL)requiresMainQueueSetup {
return true;
}
int rootViewTag = 0;
RCT_EXPORT_MODULE();
- (UIView*) shareView {
self.reactNativeDelegate = [[ReactNativeShareDelegate alloc] init];
RCTReactNativeFactory *factory = [[RCTReactNativeFactory alloc] initWithDelegate:self.reactNativeDelegate];
self.reactNativeDelegate.dependencyProvider = [RCTAppDependencyProvider new];
self.reactNativeFactory = factory;
UIView* rootView = [self.reactNativeFactory.rootViewFactory viewWithModuleName:@"NotesnookShare"];
rootViewTag = (int) rootView.tag;
rootView.window.backgroundColor =[UIColor clearColor];
rootView.layer.shadowOpacity = 0;
rootView.backgroundColor = [UIColor clearColor];
// Uncomment for console output in Xcode console for release mode on device:
// RCTSetLogThreshold(RCTLogLevelInfo - 1);
return rootView;
}
@end