"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-5187/ios/sdk/src/AppInfo.m" (2 Aug 2021, 2268 Bytes) of package /linux/misc/jitsi-meet-5187.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Matlab source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2  * Copyright @ 2017-present 8x8, Inc.
    3  *
    4  * Licensed under the Apache License, Version 2.0 (the "License");
    5  * you may not use this file except in compliance with the License.
    6  * You may obtain a copy of the License at
    7  *
    8  *     http://www.apache.org/licenses/LICENSE-2.0
    9  *
   10  * Unless required by applicable law or agreed to in writing, software
   11  * distributed under the License is distributed on an "AS IS" BASIS,
   12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13  * See the License for the specific language governing permissions and
   14  * limitations under the License.
   15  */
   16 
   17 #import <AVFoundation/AVFoundation.h>
   18 
   19 #import <React/RCTBridgeModule.h>
   20 #import <React/RCTLog.h>
   21 
   22 #import "InfoPlistUtil.h"
   23 
   24 @interface AppInfo : NSObject<RCTBridgeModule>
   25 @end
   26 
   27 @implementation AppInfo
   28 
   29 RCT_EXPORT_MODULE();
   30 
   31 + (BOOL)requiresMainQueueSetup {
   32     return NO;
   33 }
   34 
   35 - (NSDictionary *)constantsToExport {
   36     NSDictionary<NSString *, id> *infoDictionary
   37         = [[NSBundle mainBundle] infoDictionary];
   38 
   39     // calendarEnabled
   40     BOOL calendarEnabled
   41         = infoDictionary[@"NSCalendarsUsageDescription"] != nil;
   42 
   43     // name
   44     NSString *name = infoDictionary[@"CFBundleDisplayName"];
   45 
   46     if (name == nil) {
   47         name = infoDictionary[@"CFBundleName"];
   48         if (name == nil) {
   49             name = @"";
   50         }
   51     }
   52 
   53     // sdkBundlePath
   54     NSString *sdkBundlePath = [[NSBundle bundleForClass:self.class] bundlePath];
   55 
   56     // version
   57     NSString *version = infoDictionary[@"CFBundleShortVersionString"];
   58 
   59     if (version == nil) {
   60         version = infoDictionary[@"CFBundleVersion"];
   61         if (version == nil) {
   62             version = @"";
   63         }
   64     }
   65 
   66     // build number
   67     NSString *buildNumber = infoDictionary[@"CFBundleVersion"];
   68     if (buildNumber == nil) {
   69         buildNumber = @"";
   70     }
   71 
   72     BOOL isGoogleServiceEnabled = [InfoPlistUtil containsRealServiceInfoPlistInBundle:[NSBundle mainBundle]];
   73     
   74     return @{
   75         @"calendarEnabled": [NSNumber numberWithBool:calendarEnabled],
   76         @"buildNumber": buildNumber,
   77         @"name": name,
   78         @"sdkBundlePath": sdkBundlePath,
   79         @"version": version,
   80         @"GOOGLE_SERVICES_ENABLED": [NSNumber numberWithBool:isGoogleServiceEnabled]
   81     };
   82 };
   83 @end