Skip to content

Commit

Permalink
Merge pull request #313 from ConnectyCube/feature/private_calls_over_…
Browse files Browse the repository at this point in the history
…janus_example

Feature: Private calls over janus
  • Loading branch information
TatankaConCube authored Dec 4, 2023
2 parents f08901e + 577e419 commit 615b3fc
Show file tree
Hide file tree
Showing 92 changed files with 4,686 additions and 1,530 deletions.
21 changes: 20 additions & 1 deletion conf_call_sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ Project contains the following features implemented:
- Screen sharing
- Opponents' mic level monitoring
- Opponents' video bitrate monitoring
- Speaker/grid modes (the Simulcast feature is applied)
- Speaker/grid/private modes (the Simulcast feature is applied)
- CallKit
- Pre-join screen for video calls
- Switching from audio call to video without reconnection

## Documentation

Expand All @@ -25,6 +28,7 @@ ConnectyCube Conference Calls API documentation - [https://developers.connectycu
## Screenshots

<kbd><img alt="Flutter Conference Calls code sample, select users" src="https://developers.connectycube.com/docs/_images/code_samples/flutter/select_opponents_screen.png" height="440" /></kbd>
<kbd><img alt="Flutter Conference Calls code sample, video chat private" src="https://developers.connectycube.com/docs/_images/code_samples/flutter/call_screen_private.png" height="440" /></kbd></kbd>
<kbd><img alt="Flutter Conference Calls code sample, video chat" src="https://developers.connectycube.com/docs/_images/code_samples/flutter/call_screen_group.png" height="440" /></kbd></kbd>
<kbd><img alt="Flutter Conference Calls code sample, video chat (macOS)" src="https://developers.connectycube.com/docs/_images/code_samples/flutter/call_screen_macos.png" height="440" /></kbd>

Expand Down Expand Up @@ -57,6 +61,21 @@ The app will automatically run on the selected iOS device or simulator.
### Run on Linux
- Run command from the Terminal `flutter run -d linux`;

## Config for the CallKit feature
The CallKit feature is enabled by default in current version.

The push notification feature is used for implementation the participants notification about the
new call event. Do the next for configuration:

1. Create your own app in the ConnectyCube admin panel (if not created yet);
2. Create a project in the Firebase developer console (if not created yet);
3. Add the Server API key from the Firebase developer console to the ConnectyCube admin panel for the Android platform ([short guide](https://developers.connectycube.com/flutter/push-notifications?id=android));
4. Add Apple certificate for the iOS platform ([short guide, how to generate and set it to the admin panel](https://developers.connectycube.com/ios/push-notifications?id=create-apns-certificate)). But instead of an APNS certificate, you should choose a VoIP certificate;
5. Add `google-services.json` file from the Firebase developer console to the Android app by path `conf_call_sample/android/app/`
6. Configure file `conf_call_sample/lib/src/utils/configs.dart` with your endpoints from the 1st. point of this guide;
7. Create users in the ConnectyCube admin panel and add them to the configure file `conf_call_sample/lib/src/utils/configs.dart`
8. Build and run the app as usual;

## Can't build yourself?

Got troubles with building Flutter code sample? Just create an issue at [Issues page](https://github.com/ConnectyCube/connectycube-flutter-samples/issues) - we will create the sample for you. For FREE!
6 changes: 4 additions & 2 deletions conf_call_sample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdkVersion 34

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -39,7 +39,7 @@ android {
defaultConfig {
applicationId "com.connectycube.flutter.conference_call_sample"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -69,3 +69,5 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

apply plugin: 'com.google.gms.google-services'
12 changes: 12 additions & 0 deletions conf_call_sample/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
Expand Down Expand Up @@ -47,5 +49,15 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />

<meta-data
android:name="com.connectycube.flutter.connectycube_flutter_call_kit.audio_call_notification_icon"
android:resource="@drawable/ic_notification_audio_call" />
<meta-data
android:name="com.connectycube.flutter.connectycube_flutter_call_kit.video_call_notification_icon"
android:resource="@drawable/ic_notification_video_call" />
<meta-data
android:name="com.connectycube.flutter.connectycube_flutter_call_kit.app_notification_icon"
android:resource="@drawable/ic_notification" />
</application>
</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="217.39131"
android:viewportHeight="217.39131"
android:tint="#FFFFFF">
<group android:translateX="8.695652"
android:translateY="8.695652">

<path
android:fillAlpha="1"
android:fillColor="#44d2a6"
android:pathData="M187.42,50.06L100.56,0L100.56,100.13L100.56,100.13L187.42,50.06Z" />

<path
android:fillAlpha="1"
android:fillColor="#3299ac"
android:pathData="M100.56,100.13L13.7,50.06L100.56,0L100.56,0L100.56,100.13Z" />

<path
android:fillAlpha="1"
android:fillColor="#41bcf1"
android:pathData="M100.56,200L187.42,151.46L142.44,123.78L100.56,148.38L100.56,148.38L100.56,200Z" />

<path
android:fillAlpha="1"
android:fillColor="#2c85be"
android:pathData="M100.56,200L13.7,151.46L58.65,123.78L100.56,148.38L100.56,148.38L100.56,200Z" />

<path
android:fillAlpha="1"
android:fillColor="#46d1d3"
android:pathData="M13.7,151.46L13.7,50.06L58.65,75.97L58.65,123.78L58.65,123.78L13.7,151.46Z" />

</group>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#fff"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#fff"
android:pathData="M20,15.5C18.8,15.5 17.5,15.3 16.4,14.9C16.3,14.9 16.2,14.9 16.1,14.9C15.8,14.9 15.6,15 15.4,15.2L13.2,17.4C10.4,15.9 8,13.6 6.6,10.8L8.8,8.6C9.1,8.3 9.2,7.9 9,7.6C8.7,6.5 8.5,5.2 8.5,4C8.5,3.5 8,3 7.5,3H4C3.5,3 3,3.5 3,4C3,13.4 10.6,21 20,21C20.5,21 21,20.5 21,20V16.5C21,16 20.5,15.5 20,15.5M5,5H6.5C6.6,5.9 6.8,6.8 7,7.6L5.8,8.8C5.4,7.6 5.1,6.3 5,5M19,19C17.7,18.9 16.4,18.6 15.2,18.2L16.4,17C17.2,17.2 18.1,17.4 19,17.4V19Z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- drawable/video_outline.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#fff"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#fff"
android:pathData="M15,8V16H5V8H15M16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5V7A1,1 0 0,0 16,6Z" />
</vector>
Binary file not shown.
5 changes: 3 additions & 2 deletions conf_call_sample/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.20'
repositories {
google()
jcenter()
Expand All @@ -8,6 +8,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
}
}

Expand All @@ -26,6 +27,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
1 change: 0 additions & 1 deletion conf_call_sample/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
Binary file added conf_call_sample/assets/audio/calling.mp3
Binary file not shown.
Binary file added conf_call_sample/assets/audio/dialing.mp3
Binary file not shown.
Binary file added conf_call_sample/assets/audio/end_call.mp3
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.connectycube.flutter</string>
<string>group.com.connectycube.flutter.val</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ReplayKit

private enum Constants {
// the App Group ID value that the app and the broadcast extension targets are setup with. It differs for each app.
static let appGroupIdentifier = "group.com.connectycube.flutter"
static let appGroupIdentifier = "group.com.connectycube.flutter.val"
}

class SampleHandler: RPBroadcastSampleHandler {
Expand Down
2 changes: 1 addition & 1 deletion conf_call_sample/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion conf_call_sample/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
57 changes: 47 additions & 10 deletions conf_call_sample/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,42 +1,79 @@
PODS:
- assets_audio_player (0.0.1):
- Flutter
- assets_audio_player_web (0.0.1):
- Flutter
- connectycube_flutter_call_kit (2.5.0):
- Flutter
- device_info_plus (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_webrtc (0.9.20):
- flutter_webrtc (0.9.36):
- Flutter
- WebRTC-SDK (= 114.5735.08)
- package_info_plus (0.4.5):
- Flutter
- WebRTC-SDK (= 104.5112.09)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- WebRTC-SDK (104.5112.09)
- permission_handler_apple (9.1.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- WebRTC-SDK (114.5735.08)

DEPENDENCIES:
- assets_audio_player (from `.symlinks/plugins/assets_audio_player/ios`)
- assets_audio_player_web (from `.symlinks/plugins/assets_audio_player_web/ios`)
- connectycube_flutter_call_kit (from `.symlinks/plugins/connectycube_flutter_call_kit/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`)
- flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)

SPEC REPOS:
trunk:
- WebRTC-SDK

EXTERNAL SOURCES:
assets_audio_player:
:path: ".symlinks/plugins/assets_audio_player/ios"
assets_audio_player_web:
:path: ".symlinks/plugins/assets_audio_player_web/ios"
connectycube_flutter_call_kit:
:path: ".symlinks/plugins/connectycube_flutter_call_kit/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
Flutter:
:path: Flutter
flutter_webrtc:
:path: ".symlinks/plugins/flutter_webrtc/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/ios"
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"

SPEC CHECKSUMS:
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
assets_audio_player: edee322b9cb625571b830b35872ead1a295fd917
assets_audio_player_web: 19826380c44375761aa0b9053665c1e3fbc3b86b
connectycube_flutter_call_kit: cc0bbb77ddefdc484ae7608eeda046a9bb16f0c7
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_webrtc: 15c5fb4ea324f3178ff97c0f02b9467b85977e42
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
WebRTC-SDK: 3fa5c6fa717314fade68bffed85737484a28ad0b
flutter_webrtc: 55df3aaa802114dad390191a46c2c8d535751268
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
WebRTC-SDK: c24d2a6c9f571f2ed42297cb8ffba9557093142b

PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d
PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048

COCOAPODS: 1.11.3
Loading

0 comments on commit 615b3fc

Please sign in to comment.