2017-05-08 15:21:30 +00:00
|
|
|
# Jitsi Meet SDK for iOS
|
|
|
|
|
2018-12-27 15:10:03 +00:00
|
|
|
The Jitsi Meet iOS SDK provides the same user experience as the Jitsi Meet app,
|
|
|
|
in a customizable way which you can embed in your apps.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
There are 2 ways to integrate the SDK into your project:
|
|
|
|
|
|
|
|
- Using CocoaPods
|
|
|
|
- Building it yourself
|
|
|
|
|
|
|
|
### Using CocoaPods
|
|
|
|
|
|
|
|
Follow the instructions [here](https://github.com/jitsi/jitsi-meet-ios-sdk-releases/blob/master/README.md).
|
|
|
|
|
|
|
|
### Builduing it yourself
|
2017-05-08 15:21:30 +00:00
|
|
|
|
2017-09-12 01:12:11 +00:00
|
|
|
1. Install all required [dependencies](https://github.com/jitsi/jitsi-meet/blob/master/doc/mobile.md).
|
|
|
|
|
|
|
|
2. `xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS' -configuration Release archive`
|
|
|
|
|
|
|
|
After successfully building Jitsi Meet SDK for iOS, copy
|
|
|
|
`ios/sdk/JitsiMeet.framework` (if the path points to a symbolic link, follow the
|
|
|
|
symbolic link) and
|
|
|
|
`node_modules/react-native-webrtc/ios/WebRTC.framework` into your project.
|
|
|
|
|
|
|
|
## API
|
2017-05-08 15:21:30 +00:00
|
|
|
|
2017-06-06 22:43:51 +00:00
|
|
|
JitsiMeet is an iOS framework which embodies the whole Jitsi Meet experience and
|
|
|
|
makes it reusable by third-party apps.
|
2017-05-08 15:21:30 +00:00
|
|
|
|
2017-06-06 22:43:51 +00:00
|
|
|
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:
|
2017-05-08 15:21:30 +00:00
|
|
|
|
|
|
|
```objc
|
|
|
|
- (void)viewDidLoad {
|
|
|
|
[super viewDidLoad];
|
|
|
|
|
2017-07-26 19:27:29 +00:00
|
|
|
JitsiMeetView *jitsiMeetView = (JitsiMeetView *) self.view;
|
2017-06-06 22:43:51 +00:00
|
|
|
|
2017-07-26 19:27:29 +00:00
|
|
|
jitsiMeetView.delegate = self;
|
|
|
|
[jitsiMeetView loadURL:nil];
|
2017-05-08 15:21:30 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### JitsiMeetView class
|
|
|
|
|
2017-06-06 22:43:51 +00:00
|
|
|
The `JitsiMeetView` class is the entry point to the SDK. It a subclass of
|
2017-05-08 15:21:30 +00:00
|
|
|
`UIView` which renders a full conference in the designated area.
|
|
|
|
|
2017-06-09 10:30:59 +00:00
|
|
|
#### delegate
|
|
|
|
|
2017-09-27 18:08:37 +00:00
|
|
|
Property to get/set the `JitsiMeetViewDelegate` on `JitsiMeetView`.
|
2017-06-09 10:30:59 +00:00
|
|
|
|
2017-08-22 10:40:47 +00:00
|
|
|
#### defaultURL
|
|
|
|
|
2017-09-27 18:08:37 +00:00
|
|
|
Property to get/set the default base URL used to join a conference when a
|
|
|
|
partial URL (e.g. a room name only) is specified to
|
|
|
|
`loadURLString:`/`loadURLObject:`. If not set or if set to `nil`, the default
|
|
|
|
built in JavaScript is used: https://meet.jit.si.
|
2017-08-22 10:40:47 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
NOTE: Must be set (if at all) before `loadURL:`/`loadURLString:` for it to take
|
|
|
|
effect.
|
2017-08-22 10:40:47 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
#### pictureInPictureEnabled
|
2018-02-01 16:02:07 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
Property to get / set whether Picture-in-Picture is enabled. Defaults to `YES`
|
|
|
|
if `delegate` implements `enterPictureInPicture:`; otherwise, `NO`.
|
2018-02-01 16:02:07 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
NOTE: Must be set (if at all) before `loadURL:`/`loadURLString:` for it to take
|
|
|
|
effect.
|
2018-02-01 16:02:07 +00:00
|
|
|
|
2017-06-09 19:09:23 +00:00
|
|
|
#### welcomePageEnabled
|
2017-06-09 10:30:59 +00:00
|
|
|
|
2017-09-27 18:08:37 +00:00
|
|
|
Property to get/set whether the Welcome page is enabled. If `NO`, a black empty
|
|
|
|
view will be rendered when not in a conference. Defaults to `NO`.
|
2017-06-09 10:30:59 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
NOTE: Must be set (if at all) before `loadURL:`/`loadURLString:` for it to take
|
|
|
|
effect.
|
2017-06-09 10:30:59 +00:00
|
|
|
|
2017-07-26 00:06:03 +00:00
|
|
|
#### loadURL:NSURL
|
2017-06-09 10:30:59 +00:00
|
|
|
|
2017-05-08 15:21:30 +00:00
|
|
|
```objc
|
2017-07-26 19:27:29 +00:00
|
|
|
[jitsiMeetView loadURL:[NSURL URLWithString:@"https://meet.jit.si/test123"]];
|
2017-05-08 15:21:30 +00:00
|
|
|
```
|
|
|
|
|
2017-07-26 00:06:03 +00:00
|
|
|
Loads a specific URL which may identify a conference to join. If the specified
|
2017-07-26 19:27:29 +00:00
|
|
|
URL is `nil` and the Welcome page is enabled, the Welcome page is displayed
|
|
|
|
instead.
|
|
|
|
|
|
|
|
#### loadURLObject:NSDictionary
|
|
|
|
|
|
|
|
```objc
|
|
|
|
[jitsiMeetView loadURLObject:@{
|
2017-09-28 21:25:04 +00:00
|
|
|
@"config": @{
|
2017-07-26 19:27:29 +00:00
|
|
|
@"startWithAudioMuted": @YES,
|
|
|
|
@"startWithVideoMuted": @NO
|
2017-09-28 21:25:04 +00:00
|
|
|
},
|
|
|
|
@"url": @"https://meet.jit.si/test123"
|
2017-07-26 19:27:29 +00:00
|
|
|
}];
|
|
|
|
```
|
|
|
|
|
|
|
|
Loads a specific URL which may identify a conference to join. The URL is
|
|
|
|
specified in the form of an `NSDictionary` of properties which (1) internally
|
|
|
|
are sufficient to construct a URL (string) while (2) abstracting the specifics
|
|
|
|
of constructing the URL away from API clients/consumers. If the specified URL is
|
|
|
|
`nil` and the Welcome page is enabled, the Welcome page is displayed instead.
|
2017-07-26 00:06:03 +00:00
|
|
|
|
|
|
|
#### loadURLString:NSString
|
|
|
|
|
|
|
|
```objc
|
2017-07-26 19:27:29 +00:00
|
|
|
[jitsiMeetView loadURLString:@"https://meet.jit.si/test123"];
|
2017-07-26 00:06:03 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Loads a specific URL which may identify a conference to join. If the specified
|
2017-07-26 19:27:29 +00:00
|
|
|
URL is `nil` and the Welcome page is enabled, the Welcome page is displayed
|
|
|
|
instead.
|
2017-05-08 15:21:30 +00:00
|
|
|
|
|
|
|
#### Universal / deep linking
|
|
|
|
|
2017-06-06 22:43:51 +00:00
|
|
|
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.
|
2017-05-08 15:21:30 +00:00
|
|
|
|
|
|
|
```objc
|
2017-06-06 22:43:51 +00:00
|
|
|
- (BOOL)application:(UIApplication *)application
|
2017-05-08 15:21:30 +00:00
|
|
|
continueUserActivity:(NSUserActivity *)userActivity
|
2017-06-06 22:43:51 +00:00
|
|
|
restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
|
2017-05-08 15:21:30 +00:00
|
|
|
{
|
|
|
|
return [JitsiMeetView application:application
|
|
|
|
continueUserActivity:userActivity
|
|
|
|
restorationHandler:restorationHandler];
|
2017-06-06 22:43:51 +00:00
|
|
|
}
|
2018-09-25 22:28:35 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
And also one of the following:
|
2017-05-08 15:21:30 +00:00
|
|
|
|
2018-09-25 22:28:35 +00:00
|
|
|
```objc
|
|
|
|
// See https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623073-application?language=objc
|
|
|
|
- (BOOL)application:(UIApplication *)app
|
|
|
|
openURL:(NSURL *)url
|
|
|
|
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
|
|
|
|
return [JitsiMeetView application:app
|
|
|
|
openURL:url
|
|
|
|
options: options];
|
|
|
|
}
|
|
|
|
```
|
|
|
|
or
|
|
|
|
```objc
|
|
|
|
// See https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application?language=objc
|
2017-05-08 15:21:30 +00:00
|
|
|
- (BOOL)application:(UIApplication *)application
|
|
|
|
openURL:(NSURL *)url
|
|
|
|
sourceApplication:(NSString *)sourceApplication
|
2017-06-06 22:43:51 +00:00
|
|
|
annotation:(id)annotation
|
2017-05-08 15:21:30 +00:00
|
|
|
{
|
|
|
|
return [JitsiMeetView application:application
|
|
|
|
openURL:url
|
|
|
|
sourceApplication:sourceApplication
|
|
|
|
annotation:annotation];
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2018-09-28 19:54:09 +00:00
|
|
|
NOTE: The latter is deprecated.
|
|
|
|
|
2017-05-08 15:21:30 +00:00
|
|
|
### JitsiMeetViewDelegate
|
|
|
|
|
2017-06-07 15:50:30 +00:00
|
|
|
This delegate is optional, and can be set on the `JitsiMeetView` instance using
|
|
|
|
the `delegate` property.
|
|
|
|
|
|
|
|
It provides information about the conference state: was it joined, left, did it
|
|
|
|
fail?
|
|
|
|
|
|
|
|
All methods in this delegate are optional.
|
|
|
|
|
|
|
|
##### conferenceFailed
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
#### conferenceJoined
|
|
|
|
|
|
|
|
Called when a conference was joined.
|
|
|
|
|
|
|
|
The `data` dictionary contains a "url" key with the conference URL.
|
|
|
|
|
|
|
|
#### conferenceLeft
|
|
|
|
|
|
|
|
Called when a conference was left.
|
|
|
|
|
|
|
|
The `data` dictionary contains a "url" key with the conference URL.
|
|
|
|
|
|
|
|
#### conferenceWillJoin
|
|
|
|
|
|
|
|
Called before a conference is joined.
|
|
|
|
|
|
|
|
The `data` dictionary contains a "url" key with the conference URL.
|
|
|
|
|
|
|
|
#### conferenceWillLeave
|
|
|
|
|
|
|
|
Called before a conference is left.
|
|
|
|
|
|
|
|
The `data` dictionary contains a "url" key with the conference URL.
|
2017-08-25 15:21:01 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
#### enterPictureInPicture
|
|
|
|
|
|
|
|
Called when entering Picture-in-Picture is requested by the user. The app should
|
|
|
|
now activate its Picture-in-Picture implementation (and resize the associated
|
|
|
|
`JitsiMeetView`. The latter will automatically detect its new size and adjust
|
|
|
|
its user interface to a variant appropriate for the small size ordinarily
|
|
|
|
associated with Picture-in-Picture.)
|
|
|
|
|
|
|
|
The `data` dictionary is empty.
|
|
|
|
|
2017-08-25 15:21:01 +00:00
|
|
|
#### loadConfigError
|
|
|
|
|
2017-09-06 23:26:33 +00:00
|
|
|
Called when loading the main configuration file from the Jitsi Meet deployment
|
|
|
|
fails.
|
2017-08-25 15:21:01 +00:00
|
|
|
|
2017-09-06 23:26:33 +00:00
|
|
|
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.
|
2018-02-01 16:02:07 +00:00
|
|
|
|
|
|
|
### Picture-in-Picture
|
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
`JitsiMeetView` will automatically adjust its UI when presented in a
|
|
|
|
Picture-in-Picture style scenario, in a rectangle too small to accommodate its
|
|
|
|
"full" UI.
|
2018-02-01 16:02:07 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
Jitsi Meet SDK does not currently implement native Picture-in-Picture on iOS. If
|
|
|
|
desired, apps need to implement non-native Picture-in-Picture themselves and
|
|
|
|
resize `JitsiMeetView`.
|
2018-02-01 16:02:07 +00:00
|
|
|
|
2018-02-19 22:52:21 +00:00
|
|
|
If `pictureInPictureEnabled` is set to `YES` or `delegate` implements
|
|
|
|
`enterPictureInPicture:`, the in-call toolbar will render a button to afford the
|
|
|
|
user to request entering Picture-in-Picture.
|
2018-09-24 23:22:00 +00:00
|
|
|
|
|
|
|
## Dropbox integration
|
|
|
|
|
2018-09-25 22:28:35 +00:00
|
|
|
To setup the Dropbox integration, follow these steps:
|
2018-09-24 23:22:00 +00:00
|
|
|
|
2018-09-25 22:28:35 +00:00
|
|
|
1. Add the following to the app's Info.plist and change `<APP_KEY>` to your
|
|
|
|
Dropbox app key:
|
2018-09-24 23:22:00 +00:00
|
|
|
```
|
|
|
|
<key>CFBundleURLTypes</key>
|
|
|
|
<array>
|
2018-09-25 22:28:35 +00:00
|
|
|
<dict>
|
|
|
|
<key>CFBundleURLName</key>
|
|
|
|
<string></string>
|
|
|
|
<key>CFBundleURLSchemes</key>
|
|
|
|
<array>
|
|
|
|
<string>db-<APP_KEY></string>
|
|
|
|
</array>
|
|
|
|
</dict>
|
2018-09-24 23:22:00 +00:00
|
|
|
</array>
|
|
|
|
<key>LSApplicationQueriesSchemes</key>
|
|
|
|
<array>
|
2018-09-25 22:28:35 +00:00
|
|
|
<string>dbapi-2</string>
|
|
|
|
<string>dbapi-8-emm</string>
|
2018-09-24 23:22:00 +00:00
|
|
|
</array>
|
|
|
|
```
|
|
|
|
|
2018-09-25 22:28:35 +00:00
|
|
|
2. Add the following to the app's `AppDelegate`:
|
2018-09-24 23:22:00 +00:00
|
|
|
```objc
|
2018-09-25 22:28:35 +00:00
|
|
|
- (BOOL)application:(UIApplication *)app
|
|
|
|
openURL:(NSURL *)url
|
2018-09-24 23:22:00 +00:00
|
|
|
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
|
|
|
|
return [JitsiMeetView application:app
|
|
|
|
openURL:url
|
|
|
|
options:options];
|
|
|
|
}
|
|
|
|
```
|