Merge pull request #2377 from vector-im/riot_1483

Jitsi integration: Use the matching WebRTC framework
This commit is contained in:
SBiOSoftWhare
2019-04-24 16:37:15 +02:00
committed by GitHub
33 changed files with 207 additions and 1346 deletions
+1
View File
@@ -10,6 +10,7 @@ Improvements:
* iOS 12 Notification: Group them by room (#2337 and PR #2347 thanks to @fridtjof).
* Notifications: When navigate to a room, remove associated delivered notifications (#2337).
* Key backup: Adjust wording for untrusted backup to match Riot Web.
* Jitsi integration: Use the matching WebRTC framework (#1483).
Bug fix:
* Share extension: Fix a crash when receive a memory warning (PR #2352).
+1 -4
View File
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, "9.0"
platform :ios, '10.0'
# Use frameforks to allow usage of pod written in Swift (like PiwikTracker)
use_frameworks!
@@ -43,18 +43,15 @@ def import_MatrixKitAppExtension
if $matrixKitVersion == 'local'
pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec'
pod 'MatrixSDK/SwiftSupport', :path => '../matrix-ios-sdk/MatrixSDK.podspec'
pod 'MatrixSDK/JingleCallStack', :path => '../matrix-ios-sdk/MatrixSDK.podspec'
pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec'
else
if $matrixKitVersion == 'develop'
pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop'
pod 'MatrixSDK/SwiftSupport', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop'
pod 'MatrixSDK/JingleCallStack', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop'
pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop'
else
pod 'MatrixKit/AppExtension', $matrixKitVersion
pod 'MatrixSDK/SwiftSupport'
pod 'MatrixSDK/JingleCallStack'
end
end
end
+12 -39
View File
@@ -57,8 +57,6 @@
3232ABBC2257BE6500AD6A5C /* DeviceVerificationVerifyViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB42257BE6400AD6A5C /* DeviceVerificationVerifyViewAction.swift */; };
3232ABC022594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABBF22594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift */; };
3232ABC2225B996200AD6A5C /* Themable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABC1225B996100AD6A5C /* Themable.swift */; };
3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; };
3233F7471F3497E2006ACA81 /* JitsiMeet.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
324A204F225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 324A2047225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard */; };
324A2050225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A2048225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift */; };
324A2051225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A2049225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift */; };
@@ -122,6 +120,7 @@
B109D6F1222D8C400061B6D9 /* UIApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = B109D6F0222D8C400061B6D9 /* UIApplication.swift */; };
B10B3B5B2201DD740072C76B /* KeyBackupBannerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10B3B592201DD740072C76B /* KeyBackupBannerCell.swift */; };
B10B3B5C2201DD740072C76B /* KeyBackupBannerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B10B3B5A2201DD740072C76B /* KeyBackupBannerCell.xib */; };
B10CFBC32268D99D00A5842E /* JitsiService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10CFBC22268D99D00A5842E /* JitsiService.swift */; };
B1107EC82200B0720038014B /* KeyBackupRecoverSuccessViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1107EC72200B0720038014B /* KeyBackupRecoverSuccessViewController.swift */; };
B1107ECA2200B09F0038014B /* KeyBackupRecoverSuccessViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1107EC92200B09F0038014B /* KeyBackupRecoverSuccessViewController.storyboard */; };
B110871D21F087F4003554A5 /* KeyBackupSetupPassphraseViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = B110871C21F087F4003554A5 /* KeyBackupSetupPassphraseViewState.swift */; };
@@ -508,17 +507,6 @@
name = "Embed App Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
3233F7481F3497E2006ACA81 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
3233F7471F3497E2006ACA81 /* JitsiMeet.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
@@ -567,7 +555,6 @@
3232ABB42257BE6400AD6A5C /* DeviceVerificationVerifyViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewAction.swift; sourceTree = "<group>"; };
3232ABBF22594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifyEmojiCollectionViewCell.swift; sourceTree = "<group>"; };
3232ABC1225B996100AD6A5C /* Themable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Themable.swift; sourceTree = "<group>"; };
3233F7441F3497DA006ACA81 /* JitsiMeet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = "<group>"; };
324A2047225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = DeviceVerificationIncomingViewController.storyboard; sourceTree = "<group>"; };
324A2048225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingViewController.swift; sourceTree = "<group>"; };
324A2049225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingViewState.swift; sourceTree = "<group>"; };
@@ -654,6 +641,7 @@
B109D6F0222D8C400061B6D9 /* UIApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIApplication.swift; sourceTree = "<group>"; };
B10B3B592201DD740072C76B /* KeyBackupBannerCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBackupBannerCell.swift; sourceTree = "<group>"; };
B10B3B5A2201DD740072C76B /* KeyBackupBannerCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KeyBackupBannerCell.xib; sourceTree = "<group>"; };
B10CFBC22268D99D00A5842E /* JitsiService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JitsiService.swift; sourceTree = "<group>"; };
B1107EC72200B0720038014B /* KeyBackupRecoverSuccessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBackupRecoverSuccessViewController.swift; sourceTree = "<group>"; };
B1107EC92200B09F0038014B /* KeyBackupRecoverSuccessViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = KeyBackupRecoverSuccessViewController.storyboard; sourceTree = "<group>"; };
B110871C21F087F4003554A5 /* KeyBackupSetupPassphraseViewState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBackupSetupPassphraseViewState.swift; sourceTree = "<group>"; };
@@ -1225,7 +1213,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */,
89C94E649229EA68AE787E9E /* Pods_RiotPods_Riot.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1404,22 +1391,6 @@
path = Views;
sourceTree = "<group>";
};
3233F7291F31F3B4006ACA81 /* libs */ = {
isa = PBXGroup;
children = (
3233F7431F3497DA006ACA81 /* jitsi-meet */,
);
path = libs;
sourceTree = "<group>";
};
3233F7431F3497DA006ACA81 /* jitsi-meet */ = {
isa = PBXGroup;
children = (
3233F7441F3497DA006ACA81 /* JitsiMeet.framework */,
);
path = "jitsi-meet";
sourceTree = "<group>";
};
324A2046225FC571004FE8B0 /* Incoming */ = {
isa = PBXGroup;
children = (
@@ -2439,9 +2410,10 @@
B1B5576920EE702800210D55 /* Jitsi */ = {
isa = PBXGroup;
children = (
B10CFBC22268D99D00A5842E /* JitsiService.swift */,
B1B5576A20EE702800210D55 /* JitsiViewController.h */,
B1B5576B20EE702800210D55 /* JitsiViewController.xib */,
B1B5576C20EE702800210D55 /* JitsiViewController.m */,
B1B5576B20EE702800210D55 /* JitsiViewController.xib */,
);
path = Jitsi;
sourceTree = "<group>";
@@ -3097,7 +3069,6 @@
B1B5597C20EFC3DF00210D55 /* Managers */,
B1B5567620EE6C4C00210D55 /* Modules */,
F083BC0F1E7009EC00A9B29C /* Utils */,
3233F7291F31F3B4006ACA81 /* libs */,
F083BB0E1E7009EC00A9B29C /* Assets */,
B169329D20F3A21B00746532 /* SupportingFiles */,
);
@@ -3278,7 +3249,6 @@
F094A99F1B78D8F000B1FBBF /* Frameworks */,
F094A9A01B78D8F000B1FBBF /* Resources */,
24CBEC5D1F0EAD310093EABB /* Embed App Extensions */,
3233F7481F3497E2006ACA81 /* Embed Frameworks */,
5C50A1C53E6A24258653D624 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
@@ -3608,13 +3578,14 @@
"${BUILT_PRODUCTS_DIR}/GBDeviceInfo/GBDeviceInfo.framework",
"${BUILT_PRODUCTS_DIR}/GZIP/GZIP.framework",
"${BUILT_PRODUCTS_DIR}/HPGrowingTextView/HPGrowingTextView.framework",
"${PODS_ROOT}/JitsiMeetSDK/Frameworks/JitsiMeet.framework",
"${PODS_ROOT}/JitsiMeetSDK/Frameworks/WebRTC.framework",
"${BUILT_PRODUCTS_DIR}/MatrixKit/MatrixKit.framework",
"${BUILT_PRODUCTS_DIR}/MatrixSDK/MatrixSDK.framework",
"${BUILT_PRODUCTS_DIR}/MatrixSDK.common-JingleCallStack/MatrixSDK.framework",
"${BUILT_PRODUCTS_DIR}/OLMKit/OLMKit.framework",
"${BUILT_PRODUCTS_DIR}/PiwikTracker/PiwikTracker.framework",
"${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
"${BUILT_PRODUCTS_DIR}/Reusable/Reusable.framework",
"${PODS_ROOT}/WebRTC/WebRTC.framework",
"${BUILT_PRODUCTS_DIR}/cmark/cmark.framework",
"${BUILT_PRODUCTS_DIR}/libPhoneNumber-iOS/libPhoneNumber_iOS.framework",
"${BUILT_PRODUCTS_DIR}/libbase58/libbase58.framework",
@@ -3630,13 +3601,14 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GBDeviceInfo.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GZIP.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HPGrowingTextView.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JitsiMeet.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MatrixKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MatrixSDK.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OLMKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PiwikTracker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reusable.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/cmark.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libPhoneNumber_iOS.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libbase58.framework",
@@ -3842,6 +3814,7 @@
B1CE9EFD22148703000FAE6A /* SignOutAlertPresenter.swift in Sources */,
32F6B9692270623100BBA352 /* DeviceVerificationDataLoadingCoordinator.swift in Sources */,
B1B5594720EF7BD000210D55 /* RoomCollectionViewCell.m in Sources */,
B10CFBC32268D99D00A5842E /* JitsiService.swift in Sources */,
B1B558C120EF768F00210D55 /* RoomIncomingEncryptedAttachmentWithPaginationTitleBubbleCell.m in Sources */,
B1B5573E20EE6C4D00210D55 /* RiotNavigationController.m in Sources */,
B1B5593B20EF7BAC00210D55 /* TableViewCellWithCheckBoxAndLabel.m in Sources */,
@@ -4417,7 +4390,7 @@
"\"$(PROJECT_DIR)/Riot/libs/jitsi-meet\"",
);
INFOPLIST_FILE = Riot/SupportingFiles/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -4458,7 +4431,7 @@
"\"$(PROJECT_DIR)/Riot/libs/jitsi-meet\"",
);
INFOPLIST_FILE = Riot/SupportingFiles/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
+23 -1
View File
@@ -491,6 +491,15 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
// Add matrix observers, and initialize matrix sessions if the app is not launched in background.
[self initMatrixSessions];
// Setup Jitsi
NSString *jitsiServerStringURL = [[NSUserDefaults standardUserDefaults] objectForKey:@"jitsiServerURL"];
NSURL *jitsiServerURL = [NSURL URLWithString:jitsiServerStringURL];
[JitsiService.shared configureDefaultConferenceOptionsWith:jitsiServerURL];
[JitsiService.shared application:application didFinishLaunchingWithOptions:launchOptions];
NSLog(@"[AppDelegate] didFinishLaunchingWithOptions: Done in %.0fms", [[NSDate date] timeIntervalSinceDate:startDate] * 1000);
@@ -708,7 +717,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
NSLog(@"[AppDelegate] applicationDidReceiveMemoryWarning");
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
BOOL continueUserActivity = NO;
@@ -2784,6 +2793,10 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
options:NSKeyValueObservingOptionNew
context:NULL];
}
else
{
[self enableCallKit:NO forCallManager:mxSession.callManager];
}
}
else
{
@@ -3461,11 +3474,20 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
- (void)enableCallKit:(BOOL)enable forCallManager:(MXCallManager *)callManager
{
JitsiService.shared.enableCallKit = enable;
if (enable)
{
// Create adapter for Riot
MXCallKitConfiguration *callKitConfiguration = [[MXCallKitConfiguration alloc] init];
callKitConfiguration.iconName = @"riot_icon_callkit";
NSData *riotCallKitIconData = UIImagePNGRepresentation([UIImage imageNamed:callKitConfiguration.iconName]);
[JitsiService.shared configureCallKitProviderWithLocalizedName:callKitConfiguration.name
ringtoneName:callKitConfiguration.ringtoneName
iconTemplateImageData:riotCallKitIconData];
MXCallKitAdapter *callKitAdapter = [[MXCallKitAdapter alloc] initWithConfiguration:callKitConfiguration];
id<MXCallAudioSessionConfigurator> audioSessionConfigurator;
+2
View File
@@ -28,6 +28,8 @@
<string>https://scalar.vector.im/</string>
<key>integrationsRestUrl</key>
<string>https://scalar.vector.im/api</string>
<key>jitsiServerURL</key>
<string>https://jitsi.riot.im</string>
<key>integrationsWidgetsUrls</key>
<array>
<string>https://scalar-staging.riot.im/scalar/api</string>
+1
View File
@@ -22,6 +22,7 @@ internal enum RiotDefaults {
internal static let integrationsRestUrl: String = _document["integrationsRestUrl"]
internal static let integrationsUiUrl: String = _document["integrationsUiUrl"]
internal static let integrationsWidgetsUrls: [String] = _document["integrationsWidgetsUrls"]
internal static let jitsiServerURL: String = _document["jitsiServerURL"]
internal static let matrixApps: Bool = _document["matrixApps"]
internal static let maxAllowedMediaCacheSize: Int = _document["maxAllowedMediaCacheSize"]
internal static let pinRoomsWithMissedNotif: Bool = _document["pinRoomsWithMissedNotif"]
@@ -0,0 +1,70 @@
/*
Copyright 2019 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import Foundation
import JitsiMeet
/// JitsiService enables to abstract and configure Jitsi Meet SDK
@objcMembers
final class JitsiService: NSObject {
static let shared = JitsiService()
// MARK: - Properties
var enableCallKit: Bool = true {
didSet {
JMCallKitProxy.enabled = enableCallKit
}
}
private let jitsiMeet = JitsiMeet.sharedInstance()
// MARK: - Setup
private override init() {
super.init()
}
// MARK: - Public
// MARK: Configuration
func configureDefaultConferenceOptions(with serverURL: URL) {
self.jitsiMeet.defaultConferenceOptions = JitsiMeetConferenceOptions.fromBuilder({ (builder) in
builder.serverURL = serverURL
})
}
func configureCallKitProvider(localizedName: String, ringtoneName: String?, iconTemplateImageData: Data?) {
JMCallKitProxy.configureProvider(localizedName: localizedName, ringtoneSound: ringtoneName, iconTemplateImageData: iconTemplateImageData)
}
// MARK: AppDelegate methods
@discardableResult
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
return self.jitsiMeet.application(application, didFinishLaunchingWithOptions: launchOptions ?? [:])
}
func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
return self.jitsiMeet.application(application, open: url, options: options)
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return self.jitsiMeet.application(application, continue: userActivity, restorationHandler: restorationHandler)
}
}
@@ -16,8 +16,6 @@
#import <MatrixKit/MatrixKit.h>
#import <JitsiMeet/JitsiMeet.h>
#import "WidgetManager.h"
@protocol JitsiViewControllerDelegate;
@@ -28,7 +26,7 @@
https://github.com/jitsi/jitsi-meet/tree/master/ios
*/
@interface JitsiViewController : MXKViewController <JitsiMeetViewDelegate>
@interface JitsiViewController : MXKViewController
/**
Returns the `UINib` object initialized for a `JitsiViewController`.
@@ -75,12 +73,6 @@
*/
@property (nonatomic) id<JitsiViewControllerDelegate> delegate;
#pragma mark - Xib attributes
// The jitsi-meet SDK view
@property (weak, nonatomic) IBOutlet JitsiMeetView *jitsiMeetView;
@property (weak, nonatomic) IBOutlet UIButton *backToAppButton;
@end
@@ -15,15 +15,17 @@
*/
#import "JitsiViewController.h"
@import JitsiMeet;
static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/";
static const NSString *kJitsiDataErrorKey = @"error";
@interface JitsiViewController ()
{
NSString *jitsiUrl;
@interface JitsiViewController () <JitsiMeetViewDelegate>
BOOL video;
}
// The jitsi-meet SDK view
@property (nonatomic, weak) IBOutlet JitsiMeetView *jitsiMeetView;
@property (nonatomic, strong) NSString *conferenceId;
@property (nonatomic) BOOL startWithVideo;
@end
@@ -44,14 +46,41 @@ static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/";
return jitsiViewController;
}
#pragma mark - Life cycle
- (void)viewDidLoad
{
[super viewDidLoad];
self.jitsiMeetView.delegate = self;
[self joinConference];
}
- (BOOL)prefersStatusBarHidden
{
return YES;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
#pragma mark - Public
- (void)openWidget:(Widget*)widget withVideo:(BOOL)aVideo
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure
{
video = aVideo;
self.startWithVideo = aVideo;
_widget = widget;
MXWeakify(self);
[_widget widgetUrl:^(NSString * _Nonnull widgetUrl) {
MXStrongifyAndReturnIfNil(self);
// Extract the jitsi conference id from the widget url
NSString *confId;
@@ -69,15 +98,11 @@ static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/";
break;
}
}
// And build from it the url to use in jitsi-meet sdk
if (confId)
{
jitsiUrl = [NSString stringWithFormat:@"%@%@", kJitsiServerUrl, confId];
}
}
self.conferenceId = confId;
if (jitsiUrl)
if (confId)
{
if (success)
{
@@ -107,71 +132,72 @@ static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/";
- (void)hangup
{
jitsiUrl = nil;
[self.jitsiMeetView leave];
}
// It would have been nicer to ask JitsiMeetView but there is no api.
// Dismissing the view controller and releasing it does the job for the moment
if (_delegate)
#pragma mark - Private
- (void)joinConference
{
[self joinConferenceWithId:self.conferenceId];
}
- (void)joinConferenceWithId:(NSString*)conferenceId
{
if (conferenceId)
{
[_delegate jitsiViewController:self dismissViewJitsiController:nil];
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.jitsiMeetView.delegate = self;
// Pass the URL to jitsi-meet sdk
[self.jitsiMeetView loadURLObject: @{
@"url": jitsiUrl,
@"configOverwrite": @{
@"startWithVideoMuted": @(!video)
}
}];
// TODO: Set up user info but it is not yet available in the jitsi-meet iOS SDK
// See https://github.com/jitsi/jitsi-meet/issues/1880
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
#pragma mark - Actions
- (IBAction)onBackToAppButtonPressed:(id)sender
{
if (_delegate)
{
[_delegate jitsiViewController:self goBackToApp:nil];
// TODO: Set up user info but it is not yet available in the jitsi-meet iOS SDK
// See https://github.com/jitsi/jitsi-meet/issues/1880
JitsiMeetConferenceOptions *jitsiMeetConferenceOptions = [JitsiMeetConferenceOptions fromBuilder:^(JitsiMeetConferenceOptionsBuilder * _Nonnull jitsiMeetConferenceOptionsBuilder) {
jitsiMeetConferenceOptionsBuilder.room = conferenceId;
jitsiMeetConferenceOptionsBuilder.videoMuted = !self.startWithVideo;
}];
[self.jitsiMeetView join:jitsiMeetConferenceOptions];
}
}
#pragma mark - JitsiMeetViewDelegate
- (void)conferenceFailed:(NSDictionary *)data
- (void)conferenceWillJoin:(NSDictionary *)data
{
NSLog(@"[JitsiViewController] conferenceFailed - data: %@", data);
}
- (void)conferenceLeft:(NSDictionary *)data
- (void)conferenceJoined:(NSDictionary *)data
{
dispatch_async(dispatch_get_main_queue(), ^{
// The conference is over. Let the delegate close this view controller.
if (_delegate)
{
[_delegate jitsiViewController:self dismissViewJitsiController:nil];
}
else
{
// Do it ourself
[self dismissViewControllerAnimated:YES completion:nil];
}
});
}
- (void)conferenceTerminated:(NSDictionary *)data
{
if (data[kJitsiDataErrorKey] != nil)
{
NSLog(@"[JitsiViewController] conferenceTerminated - data: %@", data);
}
else
{
dispatch_async(dispatch_get_main_queue(), ^{
// The conference is over. Let the delegate close this view controller.
if (self.delegate)
{
[self.delegate jitsiViewController:self dismissViewJitsiController:nil];
}
else
{
// Do it ourself
[self dismissViewControllerAnimated:YES completion:nil];
}
});
}
}
- (void)enterPictureInPicture:(NSDictionary *)data
{
if (self.delegate)
{
[self.delegate jitsiViewController:self goBackToApp:nil];
}
}
@end
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="JitsiViewController">
<connections>
<outlet property="backToAppButton" destination="8tr-Cb-ue8" id="aUj-co-7JA"/>
<outlet property="jitsiMeetView" destination="7hL-Cs-mak" id="7kR-Te-Klw"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
@@ -25,41 +24,14 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<button opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8tr-Cb-ue8">
<rect key="frame" x="10" y="5" width="44" height="44"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration" identifier="CallVCBackToAppButton"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="3id-6Q-PUF"/>
<constraint firstAttribute="width" constant="44" id="JGj-Jz-SbU"/>
</constraints>
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="13"/>
<color key="tintColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="titleEdgeInsets" minX="-69" minY="61" maxX="0.0" maxY="0.0"/>
<state key="normal" image="back_icon">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="highlighted">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onBackToAppButtonPressed:" destination="-1" eventType="touchUpInside" id="2wo-nB-Rwd"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="7hL-Cs-mak" secondAttribute="trailing" id="8eH-2r-pjD"/>
<constraint firstAttribute="bottom" secondItem="7hL-Cs-mak" secondAttribute="bottom" id="BAo-6X-ovC"/>
<constraint firstItem="8tr-Cb-ue8" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="5" id="FPS-wy-gK6"/>
<constraint firstItem="8tr-Cb-ue8" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="10" id="Xca-R4-1cu"/>
<constraint firstItem="7hL-Cs-mak" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="s46-Fx-tT8"/>
<constraint firstItem="7hL-Cs-mak" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="x3v-Xl-cKi"/>
</constraints>
</view>
</objects>
<resources>
<image name="back_icon" width="13" height="23"/>
</resources>
</document>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

Binary file not shown.
Binary file not shown.
@@ -1,18 +0,0 @@
/*
* Copyright @ 2017-present Atlassian Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <JitsiMeet/JitsiMeetView.h>
#import <JitsiMeet/JitsiMeetViewDelegate.h>
@@ -1,48 +0,0 @@
/*
* Copyright @ 2017-present Atlassian Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "JitsiMeetViewDelegate.h"
@interface JitsiMeetView : UIView
@property (nonatomic, nullable, weak) id<JitsiMeetViewDelegate> delegate;
@property (copy, nonatomic, nullable) NSURL *defaultURL;
@property (nonatomic) BOOL welcomePageEnabled;
+ (BOOL)application:(UIApplication *_Nonnull)application
didFinishLaunchingWithOptions:(NSDictionary *_Nonnull)launchOptions;
+ (BOOL)application:(UIApplication * _Nonnull)application
continueUserActivity:(NSUserActivity * _Nonnull)userActivity
restorationHandler:(void (^ _Nullable)(NSArray * _Nullable))restorationHandler;
+ (BOOL)application:(UIApplication * _Nonnull)application
openURL:(NSURL * _Nonnull)URL
sourceApplication:(NSString * _Nullable)sourceApplication
annotation:(id _Nullable)annotation;
- (void)loadURL:(NSURL * _Nullable)url;
- (void)loadURLObject:(NSDictionary * _Nullable)urlObject;
- (void)loadURLString:(NSString * _Nullable)urlString;
@end
@@ -1,68 +0,0 @@
/*
* Copyright @ 2017-present Atlassian Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@protocol JitsiMeetViewDelegate <NSObject>
@optional
/**
* Called when a joining a conference was unsuccessful or when there was an
* error while in a conference.
*
* The `data` dictionary contains an `error` key describing the error and a
* `url` key with the conference URL.
*/
- (void)conferenceFailed:(NSDictionary *)data;
/**
* Called when a conference was joined.
*
* The `data` dictionary contains a `url` key with the conference URL.
*/
- (void)conferenceJoined:(NSDictionary *)data;
/**
* Called when a conference was left.
*
* The `data` dictionary contains a `url` key with the conference URL.
*/
- (void)conferenceLeft:(NSDictionary *)data;
/**
* Called before a conference is joined.
*
* The `data` dictionary contains a `url` key with the conference URL.
*/
- (void)conferenceWillJoin:(NSDictionary *)data;
/**
* Called before a conference is left.
*
* The `data` dictionary contains a `url` key with the conference URL.
*/
- (void)conferenceWillLeave:(NSDictionary *)data;
/**
* Called when loading the main configuration file from the Jitsi Meet
* deployment file.
*
* The `data` dictionary contains an `error` key with the error and a `url` key
* with the conference URL which necessitated the loading of the configuration
* file.
*/
- (void)loadConfigError:(NSDictionary *)data;
@end
Binary file not shown.
Binary file not shown.
@@ -1,6 +0,0 @@
framework module JitsiMeet {
umbrella header "JitsiMeet.h"
export *
module * { export * }
}
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
G­ηL2‰Ο»ρΏmΩ^Ϊ
-21
View File
@@ -1,21 +0,0 @@
jitsi-meet (https://github.com/jitsi/jitsi-meet) does not provide yet a pod for
iOS SDK (https://github.com/jitsi/jitsi-meet/issues/1854). So, the framework is
built as described below and it is temporarly added to the Xcode project.
jitsi doc to build JitsiMeet.framework:
- build jitsi-meet following instructions at https://github.com/jitsi/jitsi-meet#building-the-sources
- build it specifically for iOS using https://github.com/jitsi/jitsi-meet/blob/master/doc/mobile.md#ios
Step by step commands are (when you have all tools installed):
git clone https://github.com/jitsi/jitsi-meet.git
cd jitsi-meet
npm install
make
cd ios
pod install
xcodebuild -workspace jitsi-meet.xcworkspace -scheme jitsi-meet -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
Look for JitsiMeet.framework in the generated log. It will give you the full path
where Xcode has built the framework.
Then, copy the generated JitsiMeet.framework here.