2019-07-18 17:44:02 +00:00
|
|
|
//
|
|
|
|
// ShareRocketChatRN.m
|
|
|
|
// ShareRocketChatRN
|
|
|
|
//
|
|
|
|
// Created by Djorkaeff Alexandre Vilela Pereira on 16/05/19.
|
|
|
|
// Copyright © 2019 Facebook. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import "ReactNativeShareExtension.h"
|
|
|
|
#import <React/RCTBundleURLProvider.h>
|
|
|
|
#import <React/RCTRootView.h>
|
|
|
|
#import <React/RCTLog.h>
|
|
|
|
#import <Firebase.h>
|
|
|
|
|
2020-05-08 17:04:37 +00:00
|
|
|
#import <React/RCTBridgeDelegate.h>
|
|
|
|
#import <UMCore/UMModuleRegistry.h>
|
|
|
|
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
|
|
|
|
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
|
|
|
|
|
|
|
|
@interface ShareRocketChatRN : ReactNativeShareExtension <RCTBridgeDelegate>
|
|
|
|
@property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter;
|
2019-07-18 17:44:02 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation ShareRocketChatRN
|
|
|
|
|
|
|
|
RCT_EXPORT_MODULE();
|
|
|
|
|
|
|
|
- (UIView*) shareView {
|
|
|
|
NSURL *jsCodeLocation;
|
|
|
|
|
|
|
|
if(![FIRApp defaultApp]){
|
|
|
|
[FIRApp configure];
|
|
|
|
}
|
|
|
|
|
2020-05-08 17:04:37 +00:00
|
|
|
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
|
2019-07-18 17:44:02 +00:00
|
|
|
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
|
|
|
|
2020-05-08 17:04:37 +00:00
|
|
|
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
|
|
|
|
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
|
|
|
|
moduleName:@"ShareRocketChatRN"
|
|
|
|
initialProperties:nil];
|
2019-07-18 17:44:02 +00:00
|
|
|
rootView.backgroundColor = nil;
|
|
|
|
|
|
|
|
// Uncomment for console output in Xcode console for release mode on device:
|
|
|
|
// RCTSetLogThreshold(RCTLogLevelInfo - 1);
|
|
|
|
|
|
|
|
return rootView;
|
|
|
|
}
|
|
|
|
|
2020-05-08 17:04:37 +00:00
|
|
|
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
|
|
|
|
{
|
|
|
|
NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
|
|
|
|
// You can inject any extra modules that you would like here, more information at:
|
|
|
|
// https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection
|
|
|
|
return extraModules;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
|
|
{
|
|
|
|
#if DEBUG
|
|
|
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
|
|
|
#else
|
|
|
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-07-18 17:44:02 +00:00
|
|
|
@end
|