mattermost-mobile/ios/Mattermost/MattermostManaged.m
2020-11-17 14:20:58 -03:00

42 lines
1.1 KiB
Objective-C

//
// MattermostManaged.m
// Mattermost
//
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
//
#import "MattermostManaged.h"
@implementation MattermostManaged
RCT_EXPORT_MODULE();
+ (BOOL)requiresMainQueueSetup
{
return YES;
}
-(NSString *)appGroupId {
NSBundle *bundle = [NSBundle mainBundle];
NSString *appGroupId = [bundle objectForInfoDictionaryKey:@"AppGroupIdentifier"];
return appGroupId;
}
- (NSDictionary *)constantsToExport {
return @{
@"appGroupIdentifier": [self appGroupId]
};
}
RCT_EXPORT_METHOD(isRunningInSplitView:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
BOOL isRunningInFullScreen = CGRectEqualToRect(
[UIApplication sharedApplication].delegate.window.frame,
[UIApplication sharedApplication].delegate.window.screen.bounds);
resolve(@{
@"isSplitView": @(!isRunningInFullScreen)
});
}
@end