diff --git a/ios/Podfile b/ios/Podfile index dd606e4eb..eea5b633c 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,9 +1,10 @@ platform :ios, '9.0' workspace 'jitsi-meet' -project 'Jitsi Meet SDK.xcodeproj' target 'JitsiMeet' do + project 'sdk/sdk.xcodeproj' + pod 'React', :path => '../node_modules/react-native', :subspecs => [ 'Core', 'RCTActionSheet', @@ -20,7 +21,6 @@ target 'JitsiMeet' do pod 'react-native-keep-awake', :path => '../node_modules/react-native-keep-awake' pod 'react-native-webrtc', :path => '../node_modules/react-native-webrtc' pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' - end post_install do |installer| diff --git a/ios/README.md b/ios/README.md index ba671d011..3afce365f 100644 --- a/ios/README.md +++ b/ios/README.md @@ -1,60 +1,64 @@ # Jitsi Meet SDK for iOS -This directory contains the source code for Jitsi Meet for iOS (the application) -and the Jitsi Meet SDK. +This directory contains the source code of the Jitsi Meet app and the Jitsi Meet +SDK for iOS. ## Jitsi Meet SDK -JitsiMeet is an iOS framework which embodies the Jitsi Meet experience, -gift-wrapped so other applications can use it. Using it is very simple. Use -a Storyboard or Interface Builder to add a `JitsiMeetView` to your -application. +JitsiMeet is an iOS framework which embodies the whole Jitsi Meet experience and +makes it reusable by third-party apps. -Then, once the view has loaded, set the delegate in your controller and load the -desired URL: +To get started: + +1. Add a `JitsiMeetView` to your app using a Storyboard or Interface Builder, + for example. + +2. Then, once the view has loaded, set the delegate in your controller and load + the desired URL: ```objc - (void)viewDidLoad { [super viewDidLoad]; - JitsiMeetView *meetView = (JitsiMeetView*) self.view; - meetView.delegate = self; - [meetView loadURL:nil]; + JitsiMeetView *view = (JitsiMeetView *) self.view; + + view.delegate = self; + [view loadURL:nil]; } ``` ### JitsiMeetView class -The `JitsiMeetView` class is the entrypoint to the SDK. It a subclass of +The `JitsiMeetView` class is the entry point to the SDK. It a subclass of `UIView` which renders a full conference in the designated area. ```objc [meetView loadURL:[NSURL URLWithString:@"https://meet.jit.si/test123"]]; ``` -Loads the given URL and joins the room. If `null` is specified the welcome page +Loads the given URL and joins the room. If `null` is specified, the welcome page is displayed instead. #### Universal / deep linking -In order to support universal / deep linking, `JitsiMeetView` offers 2 class -methods that you application's delegate should call in order for the application -to follow those links. Example: +In order to support Universal / deep linking, `JitsiMeetView` offers 2 class +methods that you app's delegate should call in order for the app to follow those +links. ```objc -- (BOOL)application:(UIApplication *)application +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler + restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { return [JitsiMeetView application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; - } +} - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation + annotation:(id)annotation { return [JitsiMeetView application:application openURL:url diff --git a/ios/jitsi-meet.entitlements b/ios/app/app.entitlements similarity index 100% rename from ios/jitsi-meet.entitlements rename to ios/app/app.entitlements diff --git a/ios/jitsi-meet.xcodeproj/project.pbxproj b/ios/app/app.xcodeproj/project.pbxproj similarity index 90% rename from ios/jitsi-meet.xcodeproj/project.pbxproj rename to ios/app/app.xcodeproj/project.pbxproj index 1b5cbe5fd..033c32ec2 100644 --- a/ios/jitsi-meet.xcodeproj/project.pbxproj +++ b/ios/app/app.xcodeproj/project.pbxproj @@ -33,17 +33,17 @@ /* Begin PBXFileReference section */ 0B26BE6D1EC5BC3C00EEFB41 /* JitsiMeet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0B412F1D1EDEE6E800B1A0A6 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewController.h; path = app/ViewController.h; sourceTree = ""; }; - 0B412F1E1EDEE6E800B1A0A6 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ViewController.m; path = app/ViewController.m; sourceTree = ""; }; - 0B412F201EDEE95300B1A0A6 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = app/Base.lproj/Main.storyboard; sourceTree = ""; }; + 0B412F1D1EDEE6E800B1A0A6 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 0B412F1E1EDEE6E800B1A0A6 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 0B412F201EDEE95300B1A0A6 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* jitsi-meet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "jitsi-meet.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = app/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = app/AppDelegate.m; sourceTree = ""; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = app/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = app/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = app/main.m; sourceTree = ""; }; - B3B083EB1D4955FF0069CEE7 /* jitsi-meet.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "jitsi-meet.entitlements"; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + B3B083EB1D4955FF0069CEE7 /* app.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = app.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -66,29 +66,29 @@ name = Frameworks; sourceTree = ""; }; - 13B07FAE1A68108700A75B9A /* app */ = { + 13B07FAE1A68108700A75B9A /* src */ = { isa = PBXGroup; children = ( - 13B07FB71A68108700A75B9A /* main.m */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.m */, - 0B412F1D1EDEE6E800B1A0A6 /* ViewController.h */, - 0B412F1E1EDEE6E800B1A0A6 /* ViewController.m */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, - 0B412F201EDEE95300B1A0A6 /* Main.storyboard */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 13B07FB71A68108700A75B9A /* main.m */, + 0B412F201EDEE95300B1A0A6 /* Main.storyboard */, + 0B412F1D1EDEE6E800B1A0A6 /* ViewController.h */, + 0B412F1E1EDEE6E800B1A0A6 /* ViewController.m */, ); - name = app; + path = src; sourceTree = ""; }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( + B3B083EB1D4955FF0069CEE7 /* app.entitlements */, 0B26BE711EC5BC4D00EEFB41 /* Frameworks */, - 13B07FAE1A68108700A75B9A /* app */, - B3B083EB1D4955FF0069CEE7 /* jitsi-meet.entitlements */, 83CBBA001A601CBA00E9B192 /* Products */, + 13B07FAE1A68108700A75B9A /* src */, ); indentWidth = 2; sourceTree = ""; @@ -145,7 +145,7 @@ }; }; }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "jitsi-meet" */; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "app" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -189,7 +189,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "utils/fixup-ats.sh"; + shellScript = "../scripts/fixup-ats.sh"; }; 0BBA83C41EC9F7600075A103 /* Run React packager */ = { isa = PBXShellScriptBuildPhase; @@ -203,7 +203,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "utils/run-packager.sh"; + shellScript = "../scripts/run-packager.sh"; }; B35383AD1DDA0083008F406A /* Adjust embedded framework architectures */ = { isa = PBXShellScriptBuildPhase; @@ -217,7 +217,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "utils/fixup-frameworks.sh"; + shellScript = "../scripts/fixup-frameworks.sh"; }; /* End PBXShellScriptBuildPhase section */ @@ -241,7 +241,6 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; - path = app; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -251,7 +250,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = "jitsi-meet.entitlements"; + CODE_SIGN_ENTITLEMENTS = app.entitlements; CURRENT_PROJECT_VERSION = 1; DEAD_CODE_STRIPPING = NO; ENABLE_BITCODE = NO; @@ -260,7 +259,7 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, ); - INFOPLIST_FILE = app/Info.plist; + INFOPLIST_FILE = src/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(inherited)"; @@ -279,7 +278,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = "jitsi-meet.entitlements"; + CODE_SIGN_ENTITLEMENTS = app.entitlements; CURRENT_PROJECT_VERSION = 1; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -287,7 +286,7 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, ); - INFOPLIST_FILE = app/Info.plist; + INFOPLIST_FILE = src/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(inherited)"; @@ -407,7 +406,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "jitsi-meet" */ = { + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "app" */ = { isa = XCConfigurationList; buildConfigurations = ( 83CBBA201A601CBA00E9B192 /* Debug */, diff --git a/ios/jitsi-meet.xcodeproj/xcshareddata/xcschemes/jitsi-meet.xcscheme b/ios/app/app.xcodeproj/xcshareddata/xcschemes/jitsi-meet.xcscheme similarity index 91% rename from ios/jitsi-meet.xcodeproj/xcshareddata/xcschemes/jitsi-meet.xcscheme rename to ios/app/app.xcodeproj/xcshareddata/xcschemes/jitsi-meet.xcscheme index 89510fcb1..290280e34 100644 --- a/ios/jitsi-meet.xcodeproj/xcshareddata/xcschemes/jitsi-meet.xcscheme +++ b/ios/app/app.xcodeproj/xcshareddata/xcschemes/jitsi-meet.xcscheme @@ -17,7 +17,7 @@ BlueprintIdentifier = "0BD906E41EC0C00300C8C18E" BuildableName = "JitsiMeet.framework" BlueprintName = "JitsiMeet" - ReferencedContainer = "container:Jitsi Meet SDK.xcodeproj"> + ReferencedContainer = "container:sdk.xcodeproj"> + ReferencedContainer = "container:app.xcodeproj"> @@ -49,7 +49,7 @@ BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BuildableName = "jitsi-meet.app" BlueprintName = "jitsi-meet" - ReferencedContainer = "container:jitsi-meet.xcodeproj"> + ReferencedContainer = "container:app.xcodeproj"> @@ -72,7 +72,7 @@ BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BuildableName = "jitsi-meet.app" BlueprintName = "jitsi-meet" - ReferencedContainer = "container:jitsi-meet.xcodeproj"> + ReferencedContainer = "container:app.xcodeproj"> @@ -91,7 +91,7 @@ BlueprintIdentifier = "13B07F861A680F5B00A75B9A" BuildableName = "jitsi-meet.app" BlueprintName = "jitsi-meet" - ReferencedContainer = "container:jitsi-meet.xcodeproj"> + ReferencedContainer = "container:app.xcodeproj"> diff --git a/ios/app/AppDelegate.h b/ios/app/src/AppDelegate.h similarity index 99% rename from ios/app/AppDelegate.h rename to ios/app/src/AppDelegate.h index 24f760427..019665166 100644 --- a/ios/app/AppDelegate.h +++ b/ios/app/src/AppDelegate.h @@ -16,7 +16,6 @@ #import - @interface AppDelegate : UIResponder @property (nonatomic, strong) UIWindow *window; diff --git a/ios/app/AppDelegate.m b/ios/app/src/AppDelegate.m similarity index 55% rename from ios/app/AppDelegate.m rename to ios/app/src/AppDelegate.m index 372351214..495508bd4 100644 --- a/ios/app/AppDelegate.m +++ b/ios/app/src/AppDelegate.m @@ -18,34 +18,31 @@ #import - @implementation AppDelegate -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - return YES; +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + return YES; } -#pragma mark linking delegate methods +#pragma mark Linking delegate methods -- (BOOL)application:(UIApplication *)application +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler -{ - return [JitsiMeetView application:application - continueUserActivity:userActivity - restorationHandler:restorationHandler]; - } + restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { + return [JitsiMeetView application:application + continueUserActivity:userActivity + restorationHandler:restorationHandler]; +} - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation -{ - return [JitsiMeetView application:application - openURL:url - sourceApplication:sourceApplication - annotation:annotation]; + annotation:(id)annotation { + return [JitsiMeetView application:application + openURL:url + sourceApplication:sourceApplication + annotation:annotation]; } @end diff --git a/ios/app/Base.lproj/LaunchScreen.xib b/ios/app/src/Base.lproj/LaunchScreen.xib similarity index 100% rename from ios/app/Base.lproj/LaunchScreen.xib rename to ios/app/src/Base.lproj/LaunchScreen.xib diff --git a/ios/app/Base.lproj/Main.storyboard b/ios/app/src/Base.lproj/Main.storyboard similarity index 100% rename from ios/app/Base.lproj/Main.storyboard rename to ios/app/src/Base.lproj/Main.storyboard diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-76@1x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-76@1x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-76@1x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-76@1x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-76@2x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-76@2x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-76@2x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-76@2x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x.png b/ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x.png similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x.png rename to ios/app/src/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x.png diff --git a/ios/app/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/app/src/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ios/app/Images.xcassets/AppIcon.appiconset/Contents.json rename to ios/app/src/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/ios/app/Images.xcassets/Contents.json b/ios/app/src/Images.xcassets/Contents.json similarity index 100% rename from ios/app/Images.xcassets/Contents.json rename to ios/app/src/Images.xcassets/Contents.json diff --git a/ios/app/Images.xcassets/LaunchScreen.imageset/Contents.json b/ios/app/src/Images.xcassets/LaunchScreen.imageset/Contents.json similarity index 100% rename from ios/app/Images.xcassets/LaunchScreen.imageset/Contents.json rename to ios/app/src/Images.xcassets/LaunchScreen.imageset/Contents.json diff --git a/ios/app/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@1x.png b/ios/app/src/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@1x.png similarity index 100% rename from ios/app/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@1x.png rename to ios/app/src/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@1x.png diff --git a/ios/app/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@2x.png b/ios/app/src/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@2x.png similarity index 100% rename from ios/app/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@2x.png rename to ios/app/src/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@2x.png diff --git a/ios/app/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@3x.png b/ios/app/src/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@3x.png similarity index 100% rename from ios/app/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@3x.png rename to ios/app/src/Images.xcassets/LaunchScreen.imageset/LaunchScreen-480@3x.png diff --git a/ios/app/Info.plist b/ios/app/src/Info.plist similarity index 100% rename from ios/app/Info.plist rename to ios/app/src/Info.plist diff --git a/ios/app/ViewController.h b/ios/app/src/ViewController.h similarity index 99% rename from ios/app/ViewController.h rename to ios/app/src/ViewController.h index 0e89dcc63..048427e56 100644 --- a/ios/app/ViewController.h +++ b/ios/app/src/ViewController.h @@ -18,7 +18,6 @@ #import - @interface ViewController : UIViewController @end diff --git a/ios/app/ViewController.m b/ios/app/src/ViewController.m similarity index 85% rename from ios/app/ViewController.m rename to ios/app/src/ViewController.m index 54983d6e5..d2718ccf5 100644 --- a/ios/app/ViewController.m +++ b/ios/app/src/ViewController.m @@ -22,16 +22,17 @@ @implementation ViewController -- (void)viewDidLoad { - [super viewDidLoad]; - - JitsiMeetView *meetView = (JitsiMeetView*) self.view; - meetView.delegate = self; - [meetView loadURL:nil]; -} - - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } +- (void)viewDidLoad { + [super viewDidLoad]; + + JitsiMeetView *view = (JitsiMeetView *) self.view; + + view.delegate = self; + [view loadURL:nil]; +} + @end diff --git a/ios/app/main.m b/ios/app/src/main.m similarity index 81% rename from ios/app/main.m rename to ios/app/src/main.m index b52792902..e311bbf66 100644 --- a/ios/app/main.m +++ b/ios/app/src/main.m @@ -19,7 +19,10 @@ #import "AppDelegate.h" int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } + @autoreleasepool { + return UIApplicationMain( + argc, argv, + nil, + NSStringFromClass([AppDelegate class])); + } } diff --git a/ios/jitsi-meet.xcworkspace/contents.xcworkspacedata b/ios/jitsi-meet.xcworkspace/contents.xcworkspacedata index 5945cabd0..8145e614e 100644 --- a/ios/jitsi-meet.xcworkspace/contents.xcworkspacedata +++ b/ios/jitsi-meet.xcworkspace/contents.xcworkspacedata @@ -2,10 +2,10 @@ + location = "group:app/app.xcodeproj"> + location = "group:sdk/sdk.xcodeproj"> diff --git a/ios/utils/fixup-ats.sh b/ios/scripts/fixup-ats.sh similarity index 100% rename from ios/utils/fixup-ats.sh rename to ios/scripts/fixup-ats.sh diff --git a/ios/utils/fixup-frameworks.sh b/ios/scripts/fixup-frameworks.sh similarity index 100% rename from ios/utils/fixup-frameworks.sh rename to ios/scripts/fixup-frameworks.sh diff --git a/ios/utils/run-packager.sh b/ios/scripts/run-packager.sh similarity index 75% rename from ios/utils/run-packager.sh rename to ios/scripts/run-packager.sh index 00b7830b9..0ebe585cc 100755 --- a/ios/utils/run-packager.sh +++ b/ios/scripts/run-packager.sh @@ -11,6 +11,6 @@ if [[ "$CONFIGURATION" = "Debug" ]]; then exit 2 fi else - open "$SRCROOT/../node_modules/react-native/packager/launchPackager.command" || echo "Can't start packager automatically" + open "$SRCROOT/../../node_modules/react-native/packager/launchPackager.command" || echo "Can't start packager automatically" fi fi diff --git a/ios/Jitsi Meet SDK.xcodeproj/project.pbxproj b/ios/sdk/sdk.xcodeproj/project.pbxproj similarity index 84% rename from ios/Jitsi Meet SDK.xcodeproj/project.pbxproj rename to ios/sdk/sdk.xcodeproj/project.pbxproj index 679872058..06db2fabc 100644 --- a/ios/Jitsi Meet SDK.xcodeproj/project.pbxproj +++ b/ios/sdk/sdk.xcodeproj/project.pbxproj @@ -11,15 +11,15 @@ 0B412F191EDEC65D00B1A0A6 /* JitsiMeetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */; }; 0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0B93EF7B1EC608550030D24D /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B93EF7A1EC608550030D24D /* CoreText.framework */; }; - 0B93EF7E1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B93EF7C1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h */; }; - 0B93EF7F1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B93EF7D1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m */; }; + 0B93EF7E1EC9DDCD0030D24D /* RCTBridgeWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B93EF7C1EC9DDCD0030D24D /* RCTBridgeWrapper.h */; }; + 0B93EF7F1EC9DDCD0030D24D /* RCTBridgeWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B93EF7D1EC9DDCD0030D24D /* RCTBridgeWrapper.m */; }; 0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495C1EC4B6C600B793EE /* AudioMode.m */; }; 0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495D1EC4B6C600B793EE /* POSIX.m */; }; 0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495E1EC4B6C600B793EE /* Proximity.m */; }; 0BCA49641EC4B76D00B793EE /* WebRTC.framework in Copy embedded WebRTC framework */ = {isa = PBXBuildFile; fileRef = 0BCA49631EC4B76D00B793EE /* WebRTC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 0BCA496C1EC4BBF900B793EE /* jitsi.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0BCA496B1EC4BBF900B793EE /* jitsi.ttf */; }; 0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 399E84404A63DA0F3B34EB9C /* libPods-JitsiMeet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F102AB2F4BCDCF220A512816 /* libPods-JitsiMeet.a */; }; + 0F65EECE1D95DA94561BB47E /* libPods-JitsiMeet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 03F2ADC957FF109849B7FCA1 /* libPods-JitsiMeet.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -37,23 +37,23 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 062651321278D27A9BAEFAD4 /* Pods-JitsiMeet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JitsiMeet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet.debug.xcconfig"; sourceTree = ""; }; + 03F2ADC957FF109849B7FCA1 /* libPods-JitsiMeet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JitsiMeet.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 0B412F161EDEC65D00B1A0A6 /* JitsiMeetView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JitsiMeetView.h; sourceTree = ""; }; 0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitsiMeetView.m; sourceTree = ""; }; 0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeetViewDelegate.h; sourceTree = ""; }; 0B93EF7A1EC608550030D24D /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; - 0B93EF7C1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JitsiRCTBridgeWrapper.h; sourceTree = ""; }; - 0B93EF7D1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitsiRTCBridgeWrapper.m; sourceTree = ""; }; + 0B93EF7C1EC9DDCD0030D24D /* RCTBridgeWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridgeWrapper.h; sourceTree = ""; }; + 0B93EF7D1EC9DDCD0030D24D /* RCTBridgeWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBridgeWrapper.m; sourceTree = ""; }; 0BCA495C1EC4B6C600B793EE /* AudioMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioMode.m; sourceTree = ""; }; 0BCA495D1EC4B6C600B793EE /* POSIX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = POSIX.m; sourceTree = ""; }; 0BCA495E1EC4B6C600B793EE /* Proximity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Proximity.m; sourceTree = ""; }; - 0BCA49631EC4B76D00B793EE /* WebRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebRTC.framework; path = "../node_modules/react-native-webrtc/ios/WebRTC.framework"; sourceTree = ""; }; - 0BCA496B1EC4BBF900B793EE /* jitsi.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = jitsi.ttf; path = ../fonts/jitsi.ttf; sourceTree = ""; }; + 0BCA49631EC4B76D00B793EE /* WebRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebRTC.framework; path = "../../node_modules/react-native-webrtc/ios/WebRTC.framework"; sourceTree = ""; }; + 0BCA496B1EC4BBF900B793EE /* jitsi.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = jitsi.ttf; path = ../../fonts/jitsi.ttf; sourceTree = ""; }; 0BD906E51EC0C00300C8C18E /* JitsiMeet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JitsiMeet.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeet.h; sourceTree = ""; }; 0BD906E91EC0C00300C8C18E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E358F7AEFCB4033712107DF5 /* Pods-JitsiMeet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JitsiMeet.release.xcconfig"; path = "Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet.release.xcconfig"; sourceTree = ""; }; - F102AB2F4BCDCF220A512816 /* libPods-JitsiMeet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JitsiMeet.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 98E09B5C73D9036B4ED252FC /* Pods-JitsiMeet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JitsiMeet.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet.debug.xcconfig"; sourceTree = ""; }; + 9C77CA3CC919B081F1A52982 /* Pods-JitsiMeet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JitsiMeet.release.xcconfig"; path = "../Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,7 +62,7 @@ buildActionMask = 2147483647; files = ( 0B93EF7B1EC608550030D24D /* CoreText.framework in Frameworks */, - 399E84404A63DA0F3B34EB9C /* libPods-JitsiMeet.a in Frameworks */, + 0F65EECE1D95DA94561BB47E /* libPods-JitsiMeet.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -80,11 +80,11 @@ 0BD906DB1EC0C00300C8C18E = { isa = PBXGroup; children = ( - 0BCA49681EC4BBE500B793EE /* Resources */, - 0BD906E71EC0C00300C8C18E /* sdk */, - 0BD906E61EC0C00300C8C18E /* Products */, - C2471A7E156487CC2009E5E0 /* Pods */, 9C3C6FA2341729836589B856 /* Frameworks */, + C5E72ADFC30ED96F9B35F076 /* Pods */, + 0BD906E61EC0C00300C8C18E /* Products */, + 0BCA49681EC4BBE500B793EE /* Resources */, + 0BD906E71EC0C00300C8C18E /* src */, ); sourceTree = ""; }; @@ -96,21 +96,21 @@ name = Products; sourceTree = ""; }; - 0BD906E71EC0C00300C8C18E /* sdk */ = { + 0BD906E71EC0C00300C8C18E /* src */ = { isa = PBXGroup; children = ( - 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */, 0BCA495C1EC4B6C600B793EE /* AudioMode.m */, - 0BCA495D1EC4B6C600B793EE /* POSIX.m */, - 0BCA495E1EC4B6C600B793EE /* Proximity.m */, 0BD906E91EC0C00300C8C18E /* Info.plist */, - 0B93EF7C1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h */, - 0B93EF7D1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m */, - 0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */, + 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */, 0B412F161EDEC65D00B1A0A6 /* JitsiMeetView.h */, 0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */, + 0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */, + 0B93EF7C1EC9DDCD0030D24D /* RCTBridgeWrapper.h */, + 0B93EF7D1EC9DDCD0030D24D /* RCTBridgeWrapper.m */, + 0BCA495D1EC4B6C600B793EE /* POSIX.m */, + 0BCA495E1EC4B6C600B793EE /* Proximity.m */, ); - path = sdk; + path = src; sourceTree = ""; }; 9C3C6FA2341729836589B856 /* Frameworks */ = { @@ -118,16 +118,16 @@ children = ( 0B93EF7A1EC608550030D24D /* CoreText.framework */, 0BCA49631EC4B76D00B793EE /* WebRTC.framework */, - F102AB2F4BCDCF220A512816 /* libPods-JitsiMeet.a */, + 03F2ADC957FF109849B7FCA1 /* libPods-JitsiMeet.a */, ); name = Frameworks; sourceTree = ""; }; - C2471A7E156487CC2009E5E0 /* Pods */ = { + C5E72ADFC30ED96F9B35F076 /* Pods */ = { isa = PBXGroup; children = ( - 062651321278D27A9BAEFAD4 /* Pods-JitsiMeet.debug.xcconfig */, - E358F7AEFCB4033712107DF5 /* Pods-JitsiMeet.release.xcconfig */, + 98E09B5C73D9036B4ED252FC /* Pods-JitsiMeet.debug.xcconfig */, + 9C77CA3CC919B081F1A52982 /* Pods-JitsiMeet.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -140,7 +140,7 @@ buildActionMask = 2147483647; files = ( 0B412F181EDEC65D00B1A0A6 /* JitsiMeetView.h in Headers */, - 0B93EF7E1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h in Headers */, + 0B93EF7E1EC9DDCD0030D24D /* RCTBridgeWrapper.h in Headers */, 0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */, 0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */, ); @@ -153,14 +153,14 @@ isa = PBXNativeTarget; buildConfigurationList = 0BD906ED1EC0C00300C8C18E /* Build configuration list for PBXNativeTarget "JitsiMeet" */; buildPhases = ( - 8203CAE533C18CEC8284C979 /* [CP] Check Pods Manifest.lock */, + 26796D8589142D80C8AFDA51 /* [CP] Check Pods Manifest.lock */, 0BD906E01EC0C00300C8C18E /* Sources */, 0BD906E11EC0C00300C8C18E /* Frameworks */, 0BD906E21EC0C00300C8C18E /* Headers */, 0BD906E31EC0C00300C8C18E /* Resources */, - 512A060342EDB080C9BBD5BA /* [CP] Copy Pods Resources */, 0BCA49621EC4B74500B793EE /* Copy embedded WebRTC framework */, 0BCA49651EC4B77500B793EE /* Package React bundle */, + C7BC10B338C94EEB98048E64 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -187,7 +187,7 @@ }; }; }; - buildConfigurationList = 0BD906DF1EC0C00300C8C18E /* Build configuration list for PBXProject "Jitsi Meet SDK" */; + buildConfigurationList = 0BD906DF1EC0C00300C8C18E /* Build configuration list for PBXProject "sdk" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -228,24 +228,9 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../../node_modules/react-native/packager/react-native-xcode.sh"; }; - 512A060342EDB080C9BBD5BA /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 8203CAE533C18CEC8284C979 /* [CP] Check Pods Manifest.lock */ = { + 26796D8589142D80C8AFDA51 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -260,6 +245,21 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; + C7BC10B338C94EEB98048E64 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -267,7 +267,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0B93EF7F1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m in Sources */, + 0B93EF7F1EC9DDCD0030D24D /* RCTBridgeWrapper.m in Sources */, 0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */, 0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */, 0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */, @@ -380,7 +380,7 @@ }; 0BD906EE1EC0C00300C8C18E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 062651321278D27A9BAEFAD4 /* Pods-JitsiMeet.debug.xcconfig */; + baseConfigurationReference = 98E09B5C73D9036B4ED252FC /* Pods-JitsiMeet.debug.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; DEFINES_MODULE = YES; @@ -389,10 +389,10 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; - INFOPLIST_FILE = sdk/Info.plist; + INFOPLIST_FILE = src/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiKit; + PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiMeetSDK.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; @@ -400,7 +400,7 @@ }; 0BD906EF1EC0C00300C8C18E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E358F7AEFCB4033712107DF5 /* Pods-JitsiMeet.release.xcconfig */; + baseConfigurationReference = 9C77CA3CC919B081F1A52982 /* Pods-JitsiMeet.release.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; DEFINES_MODULE = YES; @@ -409,10 +409,10 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = NO; - INFOPLIST_FILE = sdk/Info.plist; + INFOPLIST_FILE = src/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiKit; + PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiMeetSDK.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; @@ -421,7 +421,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 0BD906DF1EC0C00300C8C18E /* Build configuration list for PBXProject "Jitsi Meet SDK" */ = { + 0BD906DF1EC0C00300C8C18E /* Build configuration list for PBXProject "sdk" */ = { isa = XCConfigurationList; buildConfigurations = ( 0BD906EB1EC0C00300C8C18E /* Debug */, diff --git a/ios/sdk/AudioMode.m b/ios/sdk/src/AudioMode.m similarity index 100% rename from ios/sdk/AudioMode.m rename to ios/sdk/src/AudioMode.m diff --git a/ios/sdk/Info.plist b/ios/sdk/src/Info.plist similarity index 85% rename from ios/sdk/Info.plist rename to ios/sdk/src/Info.plist index 90fa3558b..ee04469f5 100644 --- a/ios/sdk/Info.plist +++ b/ios/sdk/src/Info.plist @@ -20,10 +20,10 @@ $(CURRENT_PROJECT_VERSION) NSPrincipalClass - JitsiKitFonts - - jitsi.ttf - FontAwesome.ttf - + JitsiMeetFonts + + FontAwesome.ttf + jitsi.ttf + diff --git a/ios/sdk/JitsiMeet.h b/ios/sdk/src/JitsiMeet.h similarity index 100% rename from ios/sdk/JitsiMeet.h rename to ios/sdk/src/JitsiMeet.h diff --git a/ios/sdk/JitsiMeetView.h b/ios/sdk/src/JitsiMeetView.h similarity index 85% rename from ios/sdk/JitsiMeetView.h rename to ios/sdk/src/JitsiMeetView.h index 3c744e57b..b7c5a35a0 100644 --- a/ios/sdk/JitsiMeetView.h +++ b/ios/sdk/src/JitsiMeetView.h @@ -19,14 +19,13 @@ #import "JitsiMeetViewDelegate.h" - @interface JitsiMeetView : UIView @property (nonatomic, weak, nullable) id delegate; -+ (BOOL)application:(UIApplication *)application -continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *))restorationHandler; ++ (BOOL)application:(UIApplication *)application + continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray *))restorationHandler; + (BOOL)application:(UIApplication *)application openURL:(NSURL *)URL diff --git a/ios/sdk/JitsiMeetView.m b/ios/sdk/src/JitsiMeetView.m similarity index 86% rename from ios/sdk/JitsiMeetView.m rename to ios/sdk/src/JitsiMeetView.m index 1abdfedf1..6129193f4 100644 --- a/ios/sdk/JitsiMeetView.m +++ b/ios/sdk/src/JitsiMeetView.m @@ -21,8 +21,7 @@ #import #import "JitsiMeetView.h" -#import "JitsiRCTBridgeWrapper.h" - +#import "RCTBridgeWrapper.h" /** * A RCTFatalHandler implementation which swallows JavaScript errors. @@ -31,8 +30,7 @@ * effectively kill the application. _RCTFatal is suitable to be in * accord with the Web i.e. not kill the application. */ -RCTFatalHandler _RCTFatal = ^(NSError *error) -{ +RCTFatalHandler _RCTFatal = ^(NSError *error) { id jsStackTrace = error.userInfo[RCTJSStackTraceKey]; @try { NSString *name @@ -48,25 +46,22 @@ RCTFatalHandler _RCTFatal = ^(NSError *error) } }; - @interface JitsiMeetView() { RCTRootView *rootView; } @end - @implementation JitsiMeetView -static JitsiRCTBridgeWrapper *jitsiBridge; +static RCTBridgeWrapper *bridgeWrapper; - -#pragma mark linking delegate helpers +#pragma mark Linking delegate helpers // https://facebook.github.io/react-native/docs/linking.html -+ (BOOL)application:(UIApplication *)application -continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler ++ (BOOL)application:(UIApplication *)application + continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { return [RCTLinkingManager application:application continueUserActivity:userActivity @@ -76,8 +71,7 @@ continueUserActivity:(NSUserActivity *)userActivity + (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation -{ + annotation:(id)annotation { return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication @@ -86,9 +80,8 @@ continueUserActivity:(NSUserActivity *)userActivity #pragma mark initializers -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; +- (instancetype)initWithCoder:(NSCoder *)coder { + self = [super initWithCoder:coder]; if (self) { [self initialize]; } @@ -96,9 +89,8 @@ continueUserActivity:(NSUserActivity *)userActivity return self; } -- (instancetype)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; if (self) { [self initialize]; } @@ -112,12 +104,12 @@ continueUserActivity:(NSUserActivity *)userActivity * Loads the given URL and joins the specified conference. If the specified URL * is null, the welcome page is shown. */ -- (void)loadURL:(NSURL *)url -{ +- (void)loadURL:(NSURL *)url { NSDictionary *props = url ? @{ url : url.absoluteString } : nil; + if (rootView == nil) { rootView - = [[RCTRootView alloc] initWithBridge:jitsiBridge.bridge + = [[RCTRootView alloc] initWithBridge:bridgeWrapper.bridge moduleName:@"App" initialProperties:props]; rootView.backgroundColor = self.backgroundColor; @@ -126,7 +118,7 @@ continueUserActivity:(NSUserActivity *)userActivity [rootView setFrame:[self bounds]]; [self addSubview:rootView]; } else { - // Update props with the new URL + // Update props with the new URL. rootView.appProperties = props; } } @@ -141,8 +133,7 @@ continueUserActivity:(NSUserActivity *)userActivity * - loads the necessary custom fonts * - registers a custom fatal error error handler for React */ -- (void)initialize -{ +- (void)initialize { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -153,7 +144,7 @@ continueUserActivity:(NSUserActivity *)userActivity = [UIColor colorWithRed:.07f green:.07f blue:.07f alpha:1]; // Initialize the React bridge. - jitsiBridge = [[JitsiRCTBridgeWrapper alloc] init]; + bridgeWrapper = [[RCTBridgeWrapper alloc] init]; // Dynamically load custom bundled fonts. [self loadCustomFonts]; @@ -167,10 +158,9 @@ continueUserActivity:(NSUserActivity *)userActivity * Helper function to dynamically load custom fonts. The UIAppFonts key in the * plist file doesn't work for frameworks, so fonts have to be manually loaded. */ -- (void)loadCustomFonts -{ +- (void)loadCustomFonts { NSBundle *bundle = [NSBundle bundleForClass:self.class]; - NSArray *fonts = [bundle objectForInfoDictionaryKey:@"JitsiKitFonts"]; + NSArray *fonts = [bundle objectForInfoDictionaryKey:@"JitsiMeetFonts"]; for (NSString *item in fonts) { NSString *fontName = [item stringByDeletingPathExtension]; @@ -181,8 +171,10 @@ continueUserActivity:(NSUserActivity *)userActivity CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)inData); CGFontRef font = CGFontCreateWithDataProvider(provider); + if (!CTFontManagerRegisterGraphicsFont(font, &error)) { CFStringRef errorDescription = CFErrorCopyDescription(error); + NSLog(@"Failed to load font: %@", errorDescription); CFRelease(errorDescription); } @@ -196,8 +188,7 @@ continueUserActivity:(NSUserActivity *)userActivity * won't kill the process, it will swallow JS errors and print stack traces * instead. */ -- (void)registerFatalErrorHandler -{ +- (void)registerFatalErrorHandler { #if !DEBUG // In the Release configuration, React Native will (intentionally) raise // an unhandled NSException for an unhandled JavaScript error. This will diff --git a/ios/sdk/JitsiMeetViewDelegate.h b/ios/sdk/src/JitsiMeetViewDelegate.h similarity index 100% rename from ios/sdk/JitsiMeetViewDelegate.h rename to ios/sdk/src/JitsiMeetViewDelegate.h diff --git a/ios/sdk/POSIX.m b/ios/sdk/src/POSIX.m similarity index 100% rename from ios/sdk/POSIX.m rename to ios/sdk/src/POSIX.m diff --git a/ios/sdk/Proximity.m b/ios/sdk/src/Proximity.m similarity index 100% rename from ios/sdk/Proximity.m rename to ios/sdk/src/Proximity.m diff --git a/ios/sdk/JitsiRCTBridgeWrapper.h b/ios/sdk/src/RCTBridgeWrapper.h similarity index 95% rename from ios/sdk/JitsiRCTBridgeWrapper.h rename to ios/sdk/src/RCTBridgeWrapper.h index 2932db203..f20128150 100644 --- a/ios/sdk/JitsiRCTBridgeWrapper.h +++ b/ios/sdk/src/RCTBridgeWrapper.h @@ -30,7 +30,7 @@ * singleton, however, so it's possible for us to create multiple instances of * it, though that's not currently used. */ -@interface JitsiRCTBridgeWrapper : NSObject +@interface RCTBridgeWrapper : NSObject @property (nonatomic, readonly, strong) RCTBridge *bridge; diff --git a/ios/sdk/JitsiRTCBridgeWrapper.m b/ios/sdk/src/RCTBridgeWrapper.m similarity index 60% rename from ios/sdk/JitsiRTCBridgeWrapper.m rename to ios/sdk/src/RCTBridgeWrapper.m index 3e936c290..3177a2baa 100644 --- a/ios/sdk/JitsiRTCBridgeWrapper.m +++ b/ios/sdk/src/RCTBridgeWrapper.m @@ -14,18 +14,16 @@ * limitations under the License. */ -#include "JitsiRCTBridgeWrapper.h" +#include "RCTBridgeWrapper.h" /* * Wrapper around RCTBridge which also implements the RCTBridgeDelegate methods, * allowing us to specify where the bundles are loaded from. */ -@implementation JitsiRCTBridgeWrapper +@implementation RCTBridgeWrapper -- (instancetype)init -{ +- (instancetype)init { self = [super init]; - if (self) { _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil]; } @@ -36,16 +34,15 @@ #pragma mark helper methods for getting the packager URL #if DEBUG -static NSURL *serverRootWithHost(NSString *host) -{ - return [NSURL URLWithString: - [NSString stringWithFormat:@"http://%@:8081/", host]]; +static NSURL *serverRootWithHost(NSString *host) { + return + [NSURL URLWithString: + [NSString stringWithFormat:@"http://%@:8081/", host]]; } -- (BOOL)isPackagerRunning:(NSString *)host -{ - NSURL *url = [serverRootWithHost(host) - URLByAppendingPathComponent:@"status"]; +- (BOOL)isPackagerRunning:(NSString *)host { + NSURL *url + = [serverRootWithHost(host) URLByAppendingPathComponent:@"status"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSURLResponse *response; NSData *data = [NSURLConnection sendSynchronousRequest:request @@ -53,24 +50,29 @@ static NSURL *serverRootWithHost(NSString *host) error:NULL]; NSString *status = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + return [status isEqualToString:@"packager-status:running"]; } -- (NSString *)guessPackagerHost -{ +- (NSString *)guessPackagerHost { static NSString *ipGuess; static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ - NSString *ipPath = [[NSBundle bundleForClass:self.class] - pathForResource:@"ip" ofType:@"txt"]; - ipGuess = [[NSString stringWithContentsOfFile:ipPath - encoding:NSUTF8StringEncoding - error:nil] - stringByTrimmingCharactersInSet: - [NSCharacterSet newlineCharacterSet]]; + NSString *ipPath + = [[NSBundle bundleForClass:self.class] pathForResource:@"ip" + ofType:@"txt"]; + + ipGuess + = [[NSString stringWithContentsOfFile:ipPath + encoding:NSUTF8StringEncoding + error:nil] + stringByTrimmingCharactersInSet: + [NSCharacterSet newlineCharacterSet]]; }); NSString *host = ipGuess ?: @"localhost"; + if ([self isPackagerRunning:host]) { return host; } @@ -81,25 +83,24 @@ static NSURL *serverRootWithHost(NSString *host) #pragma mark RCTBridgeDelegate methods -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG - /* - * In debug mode, try to fetch the bundle from the packager, or fallback to - * the one inside the framework. The IP address for the packager host is - * fetched from the ip.txt file inside the framework. - * - * This duplicates some functionality present in RCTBundleURLProvider, but - * that mode is not designed to work inside a framework, because all - * resources are loaded from the main bundle. - */ + // In debug mode, try to fetch the bundle from the packager, or fallback to + // the one inside the framework. The IP address for the packager host is + // fetched from the ip.txt file inside the framework. + // + // This duplicates some functionality present in RCTBundleURLProvider, but + // that mode is not designed to work inside a framework, because all + // resources are loaded from the main bundle. NSString *host = [self guessPackagerHost]; + if (host != nil) { NSString *path = @"/index.ios.bundle"; NSString *query = @"platform=ios&dev=true&minify=false"; NSURLComponents *components - = [NSURLComponents componentsWithURL:serverRootWithHost(host) - resolvingAgainstBaseURL:NO]; + = [NSURLComponents componentsWithURL:serverRootWithHost(host) + resolvingAgainstBaseURL:NO]; + components.path = path; components.query = query; @@ -107,11 +108,6 @@ static NSURL *serverRootWithHost(NSString *host) } #endif - return [self fallbackSourceURLForBridge:bridge]; -} - -- (NSURL *)fallbackSourceURLForBridge:(RCTBridge *)bridge -{ return [[NSBundle bundleForClass:self.class] URLForResource:@"main" withExtension:@"jsbundle"]; }