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>
|
2022-08-08 21:02:08 +00:00
|
|
|
#import <React/RCTBridgeDelegate.h>
|
|
|
|
|
2020-08-19 17:14:22 +00:00
|
|
|
#import <MMKV/MMKV.h>
|
2019-07-18 17:44:02 +00:00
|
|
|
#import <Firebase.h>
|
2021-07-28 20:36:06 +00:00
|
|
|
#import <Bugsnag/Bugsnag.h>
|
2019-07-18 17:44:02 +00:00
|
|
|
|
2020-05-08 17:04:37 +00:00
|
|
|
@interface ShareRocketChatRN : ReactNativeShareExtension <RCTBridgeDelegate>
|
2022-08-08 21:02:08 +00:00
|
|
|
@end;
|
2019-07-18 17:44:02 +00:00
|
|
|
|
|
|
|
@implementation ShareRocketChatRN
|
|
|
|
|
|
|
|
RCT_EXPORT_MODULE();
|
|
|
|
|
|
|
|
- (UIView*) shareView {
|
|
|
|
NSURL *jsCodeLocation;
|
|
|
|
|
|
|
|
if(![FIRApp defaultApp]){
|
|
|
|
[FIRApp configure];
|
|
|
|
}
|
2021-07-28 20:36:06 +00:00
|
|
|
[Bugsnag start];
|
2019-07-18 17:44:02 +00:00
|
|
|
|
2022-08-08 21:02:08 +00:00
|
|
|
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
2019-07-18 17:44:02 +00:00
|
|
|
|
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);
|
2020-08-19 17:14:22 +00:00
|
|
|
|
|
|
|
// AppGroup MMKV
|
|
|
|
NSString *groupDir = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"AppGroup"]].path;
|
|
|
|
[MMKV initializeMMKV:nil groupDir:groupDir logLevel:MMKVLogNone];
|
2019-07-18 17:44:02 +00:00
|
|
|
|
|
|
|
return rootView;
|
|
|
|
}
|
|
|
|
|
2020-05-08 17:04:37 +00:00
|
|
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
|
|
{
|
|
|
|
#if DEBUG
|
2022-08-08 21:02:08 +00:00
|
|
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
2020-05-08 17:04:37 +00:00
|
|
|
#else
|
|
|
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-07-18 17:44:02 +00:00
|
|
|
@end
|