Skip to content

Commit

Permalink
Merge pull request #18 from JioMeet/release/0.0.17
Browse files Browse the repository at this point in the history
Release/0.0.17
  • Loading branch information
manibaratam94 authored Dec 12, 2024
2 parents 5996327 + 62e50bf commit fec6ad2
Show file tree
Hide file tree
Showing 30 changed files with 396 additions and 244 deletions.
90 changes: 27 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
3. [Prerequisites](#prerequisites)
- [Android](#android)
- [Add Plugin](#add-plugin)
- [Hilt](#hilt)
- [Authentication](#authentication)
- [iOS](#ios)
- [Require Configurations](#require-configurations)
- [Info.plist Changes](#infoplist-changes)
Expand All @@ -29,12 +29,11 @@ In Flutter Plugin , you'll find a range of powerful features designed to enhance

2. **Participant Panel**: Manage and monitor participants in real-time meetings or video calls for a seamless user experience.

3. **Virtual Background**: Customize the background of your video calls, adding a touch of professionalism or fun to your communication.
3. **Screen Sharing and Whiteboard Sharing**: Empower collaboration by sharing your screen or using a virtual whiteboard during meetings or video conferences.

4. **Screen Sharing and Whiteboard Sharing**: Empower collaboration by sharing your screen or using a virtual whiteboard during meetings or video conferences.
4. **Group Conversation**: Easily engage in text-based conversations with multiple participants in one chat group.

5. **Group Conversation**: Easily engage in text-based conversations with multiple participants in one chat group.
6. **Inspect Call Health**: Monitor the quality and performance of your audio and video calls to ensure a seamless communication experience.
5. **Inspect Call Health**: Monitor the quality and performance of your audio and video calls to ensure a seamless communication experience.


## Prerequisites
Expand All @@ -44,73 +43,36 @@ Before you begin, ensure you have met the following requirements:
### Android:
#### Add plugin:

You need to add the necessary configurations to your project's `pubspec.yaml` file:
1. You need to add the necessary configurations to your project's `pubspec.yaml` file:

```yaml
coresdk_plugin:
git:
url: https://github.com/JioMeet/JioMeetCoreTemplateSDK_Flutter.git
ref: 0.0.16
ref: 0.0.17
```
#### Authentication
2. Add `credentials.properties` File to Your Project Root

#### Hilt:
To securely add your GitHub credentials, follow these steps to create a `credentials.properties` file in the root directory of your project:

To set up Hilt in your flutter project, follow these steps:
### Step 1: Generate a Personal Access Token for GitHub

1. First, add the hilt-android-gradle-plugin plugin to your project’s root build.gradle file (**android/build.gradle**)
1. Go to **Settings** > **Developer Settings** > **Personal Access Tokens** > **Tokens (classic)** > **Generate new token**.
2. Select the following scope:
- `read:packages`
3. Generate the token and **copy it immediately**. You cannot view the token again once you leave the page. If lost, you will need to generate a new one.

```gradle
plugins {
id("com.google.dagger.hilt.android") version "2.44" apply false
}
```

2. Add the Hilt dependencies to the app-level build.gradle(**android/app/build.gradle**)

```gradle
plugins {
kotlin("kapt")
id("com.google.dagger.hilt.android")
}
android {
...
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
implementation "com.google.dagger:hilt-android:2.44"
kapt "com.google.dagger:hilt-android-compiler:2.44"
}
````
3. Create a Custom Application Class: If your users don't already have a custom Application class in their Android project, they should create one. This class will be used to initialize Hilt.
```kotlin
import android.app.Application;
import dagger.hilt.android.HiltAndroidApp;
@HiltAndroidApp
class MyApplication : Application {
// ...
}
```
### Step 2: Create the `credentials.properties` File

4. Modify AndroidManifest.xml: In the AndroidManifest.xml file of their app, users should specify the custom Application class they created as the application name. This tells Android to use their custom Application class when the app starts.
1. In the root directory of your project, create a file named `credentials.properties`.
2. Add the following content to the file, replacing placeholders with your actual GitHub credentials:

```xml
<application
android:name=".MyApplication" <!-- Specify the name of your custom Application class -->
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<!-- ... -->
</application>
```
```properties
username=your-github-username
password=your-personal-access-token
```

---
### iOS
### Require Configurations
Expand Down Expand Up @@ -162,7 +124,8 @@ final _jioCoreSdkPlugin = JioCoreSdkPlugin();
#### Join Meeting :
```dart
try {
await _coresdkPlugin.launchMeetingCoreTemplateUi("meeting_id", "meeting_password", "meeting_title","pass bool value of isInitialAudioOn", "pass bool value of isInitialVideoOn");
var meetingDetails = MeetingDetails(meetingId: "meeting_Id", meetingPin: "meeting_pin", displayName: "display_name", isInitialAudioOn: false, isInitialVideoOn: false, hostToken: "host_token");
await _coresdkPlugin.launchMeetingCoreTemplateUi(meetingDetails);
} on PlatformException {
_meetingStatus = "error while joining";
}
Expand Down Expand Up @@ -205,6 +168,7 @@ we can find all feature flags in SetCoreSdkConfig class.
import 'dart:async';
import 'package:coresdk_plugin/coresdk_plugin.dart';
import 'package:coresdk_plugin/meeting_details.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -256,8 +220,8 @@ class _MyAppState extends State<MyApp> {
TextButton(
onPressed: () async {
try {
await _coresdkPlugin.launchMeetingCoreTemplateUi(
"meeting_id", "meeting_password", "meeting_title");
var meetingDetails = MeetingDetails(meetingId: "meeting_id", meetingPin: "meeting_pin", displayName: "display_name", isInitialAudioOn: false, isInitialVideoOn: false, hostToken: "hostToken");
await _coresdkPlugin.launchMeetingCoreTemplateUi(meetingDetails);
} on PlatformException {
_meetingStatus = "error while joining";
}
Expand Down
32 changes: 19 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

group 'jio.coresdk.coresdk_plugin'
version '0.0.16'
version '0.0.17'

buildscript {
ext {
kotlin_version = '1.7.20'
hiltVersion = "2.44"
}
repositories {
google()
Expand All @@ -15,20 +14,29 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion"
}
}

def credentialsProperties = new Properties()
def credentialsPropertiesFile = rootProject.file('credentials.properties')
if (credentialsPropertiesFile.exists()) {
credentialsProperties.load(new FileInputStream(credentialsPropertiesFile))
def properties = new Properties()
def rootPropertiesFile = file("${rootDir}/../../credentials.properties")

if (rootPropertiesFile.exists()) {
System.out.println("Exists")
rootPropertiesFile.withInputStream { stream ->
properties.load(stream)
}
}

def githubUsername = properties['username'] ?: ''
def githubPassword = properties['password'] ?: ''

if (!githubUsername || !githubPassword) {
throw new GradleException("GitHub credentials not found. Please ensure `credentials.properties` exists at the project root.")
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.dagger.hilt.android'

android {
compileSdkVersion 31
Expand Down Expand Up @@ -61,8 +69,8 @@ rootProject.allprojects {
repositories {
maven {
credentials {
username credentialsProperties['username']
password credentialsProperties['password']
username githubUsername
password githubPassword
}
url = uri("https://maven.pkg.github.com/JioMeet/JioMeetCoreTemplateSDK_ANDROID")
}
Expand All @@ -75,7 +83,5 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10"
api "com.google.dagger:hilt-android:$hiltVersion"
kapt "com.google.dagger:hilt-android-compiler:$hiltVersion"
implementation 'com.jiomeet.platform:jiomeetcoretemplatesdk:3.0.1-virgin-groups'
implementation 'com.jiomeet.platform:jiomeetcoretemplatesdk:4.1.1'
}
9 changes: 9 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,21 @@
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

<application>
<activity
android:theme="@style/Theme.AppCompat"
android:name=".LaunchMeetingCoreTemplateUIActivity"
android:exported="false"
android:screenOrientation="portrait"/>
<service
android:name="org.jio.sdk.service.OnGoingScreenShareService"
android:foregroundServiceType="mediaProjection"
android:stopWithTask="false" />

</application>




</manifest>
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
package jio.coresdk.coresdk_plugin

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.Column
import com.jiomeet.core.main.models.Audience
import com.jiomeet.core.CoreApplication
import com.jiomeet.core.constant.Constant
import com.jiomeet.core.main.models.JMJoinMeetingConfig
import com.jiomeet.core.main.models.JMJoinMeetingData
import com.jiomeet.core.main.models.JMMeetingUser
import com.jiomeet.core.main.models.Speaker
import dagger.hilt.android.AndroidEntryPoint
import org.jio.sdk.analytics.AnalyticsEvent
import org.jio.sdk.common.customview.CustomView
import org.jio.sdk.common.utilities.Log
import com.jiomeet.core.utils.BaseUrl
import org.jio.sdk.sdkmanager.JioMeetConnectionListener
import org.jio.sdk.templates.core.CoreNav
import org.jio.sdk.templates.core.model.CoreData
import org.jio.sdk.templates.core.LaunchCore

@AndroidEntryPoint
class LaunchMeetingCoreTemplateUIActivity : ComponentActivity() {
private val jioMeetConnectionListener = object : JioMeetConnectionListener {
override fun onLeaveMeeting() {
Expand Down Expand Up @@ -53,6 +47,7 @@ class LaunchMeetingCoreTemplateUIActivity : ComponentActivity() {
Toast.makeText(applicationContext, getString(R.string.internet_message),Toast.LENGTH_SHORT).show()
finish()
} else if (HelperClass.checkPermission(this)) {
CoreApplication().recreateModules(this@LaunchMeetingCoreTemplateUIActivity)
openMeetingCoreTemplateUI()
} else{
requestPermissionLauncher.launch(PermissionConstant.requiredPermissions)
Expand All @@ -66,10 +61,13 @@ class LaunchMeetingCoreTemplateUIActivity : ComponentActivity() {
val displayName = data?.getString(Constants.MeetingDetails.DISPLAYNAME) ?: ""
val isInitialAudioOn = data?.getBoolean(Constants.MeetingDetails.ISINITIALAUDIOON) ?: false
val isInitialVideoOn = data?.getBoolean(Constants.MeetingDetails.ISINITIALVIDEOON) ?: false
val hostToken = data?.getString(Constants.MeetingDetails.HOSTTOKEN) ?: null

val jmJoinMeetingData = JMJoinMeetingData(
meetingId = meetingId,
meetingPin = meetingPin,
displayName = displayName,
hostToken = hostToken,
version = "",
deviceId = ""

Expand All @@ -80,17 +78,11 @@ class LaunchMeetingCoreTemplateUIActivity : ComponentActivity() {
isInitialVideoOn = isInitialVideoOn,
)
setContent {
val coreData = CoreData(
clientToken = "",
coreListener = jioMeetConnectionListener,
hostToken = "null",
LaunchCore(
jioMeetConnectionListener = jioMeetConnectionListener,
jmJoinMeetingConfig = jmJoinMeetingConfig,
jmJoinMeetingData = jmJoinMeetingData
)
Column {
Log.d("**CoreScreen","$coreData")
CoreNav(coreData = coreData)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Constants {
const val DISPLAYNAME = "displayName"
const val ISINITIALAUDIOON = "isInitialAudioOn"
const val ISINITIALVIDEOON = "isInitialVideoOn"
const val HOSTTOKEN = "host_token"
}

object MethodNames {
Expand All @@ -20,5 +21,6 @@ class Constants {
const val RC = "rc"
const val PRESTAGE = "prestage"
const val VirginGroups = "virginGroups"
const val Prod = "prod"
}
}
Loading

0 comments on commit fec6ad2

Please sign in to comment.