"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7561/ios/sdk/src/AppInfo.m" (29 Sep 2023, 2832 Bytes) of package /linux/misc/jitsi-meet-7561.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 = NO;
   41 #if !defined(JITSI_MEET_SDK_LITE)
   42     calendarEnabled = infoDictionary[@"NSCalendarsUsageDescription"] != nil;
   43 #endif
   44 
   45     // name
   46     NSString *name = infoDictionary[@"CFBundleDisplayName"];
   47 
   48     if (name == nil) {
   49         name = infoDictionary[@"CFBundleName"];
   50         if (name == nil) {
   51             name = @"";
   52         }
   53     }
   54 
   55     // sdkBundlePath
   56     NSString *sdkBundlePath = [[NSBundle bundleForClass:self.class] bundlePath];
   57 
   58     // version
   59     NSString *version = infoDictionary[@"CFBundleShortVersionString"];
   60 
   61     if (version == nil) {
   62         version = infoDictionary[@"CFBundleVersion"];
   63         if (version == nil) {
   64             version = @"";
   65         }
   66     }
   67 
   68     // SDK version
   69     NSDictionary<NSString *, id> *sdkInfoDictionary
   70         = [[NSBundle bundleForClass:self.class] infoDictionary];
   71     NSString *sdkVersion = sdkInfoDictionary[@"CFBundleShortVersionString"];
   72     if (sdkVersion == nil) {
   73         sdkVersion = @"";
   74     }
   75 
   76     // build number
   77     NSString *buildNumber = infoDictionary[@"CFBundleVersion"];
   78     if (buildNumber == nil) {
   79         buildNumber = @"";
   80     }
   81 
   82     // google services (sign in)
   83     BOOL isGoogleServiceEnabled = [InfoPlistUtil containsRealServiceInfoPlistInBundle:[NSBundle mainBundle]];
   84     
   85     // lite SDK
   86     BOOL isLiteSDK = NO;
   87 #if defined(JITSI_MEET_SDK_LITE)
   88     isLiteSDK = YES;
   89 #endif
   90 
   91     return @{
   92         @"calendarEnabled": [NSNumber numberWithBool:calendarEnabled],
   93         @"buildNumber": buildNumber,
   94         @"isLiteSDK": [NSNumber numberWithBool:isLiteSDK],
   95         @"name": name,
   96         @"sdkBundlePath": sdkBundlePath,
   97         @"sdkVersion": sdkVersion,
   98         @"version": version,
   99         @"GOOGLE_SERVICES_ENABLED": [NSNumber numberWithBool:isGoogleServiceEnabled]
  100     };
  101 };
  102 @end