Skip to content

Commit

Permalink
1.2.0-conference-kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
vdovbnya-qb committed Sep 5, 2024
1 parent df577da commit 9edff1a
Show file tree
Hide file tree
Showing 29 changed files with 773 additions and 392 deletions.
35 changes: 17 additions & 18 deletions sample-conference-kotlin/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand All @@ -13,30 +13,29 @@ apply plugin: 'com.google.gms.google-services'
apply from: "../artifacts.gradle"

repositories {
google()
jcenter()
repositories {
google()
mavenCentral()
}
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
flatDir { dirs 'libs' }
}

android {
def versionQACode = 1

compileSdkVersion 30
buildToolsVersion "30.0.3"
flavorDimensions dimensionDefault

defaultConfig {
compileSdk 34
applicationId "com.quickblox.sample.conference.kotlin"
minSdkVersion 21
targetSdkVersion 30
versionCode 110000
versionName "1.1.0"
targetSdkVersion 34
versionCode 120000
versionName "1.2.0"
multiDexEnabled true
}

flavorDimensions dimensionDefault
productFlavors {
dev {
dimension dimensionDefault
Expand All @@ -63,14 +62,15 @@ android {
release {
signingConfig signingConfigs.debug
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
resValue "string", "versionName", "QuickBlox Conference Kotlin\nBuild version " + defaultConfig.getVersionName()
}
}

buildFeatures {
viewBinding true
buildConfig true
}

signingConfigs {
Expand All @@ -83,24 +83,23 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
namespace 'com.quickblox.sample.conference.kotlin'
}

dependencies {
implementation "com.quickblox:quickblox-android-sdk-conference:$qbSdkVersion"
implementation "com.quickblox:quickblox-android-sdk-conference:$rootProject.qbSdkVersion"
implementation "com.quickblox:quickblox-android-sdk-messages:$rootProject.qbSdkVersion"
implementation "com.quickblox:quickblox-android-sdk-chat:$rootProject.qbSdkVersion"
implementation "com.quickblox:quickblox-android-sdk-content:$rootProject.qbSdkVersion"

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "com.google.android.material:material:$rootProject.materialAndroidXVersion"

implementation "androidx.appcompat:appcompat:$rootProject.appcompatAndroidXVersion"
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycleViewmodelAndroidXVersion"
Expand Down
74 changes: 32 additions & 42 deletions sample-conference-kotlin/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,63 +1,53 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# By default, the flags in this file are appended to flags specified

# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
#-dontusemixedcaseclassnames
#-dontskipnonpubliclibraryclasses
#-verbose
#

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes EnclosingMethod
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes Exceptions

# For using GSON @Expose annotation
# for using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.quickblox.core.account.model.** { *; }

-keep class com.quickblox.auth.parsers.** { *; }
-keep class com.quickblox.auth.model.** { *; }
-keep class com.quickblox.core.parser.** { *; }
-keep class com.quickblox.core.model.** { *; }
-keep class com.quickblox.core.server.** { *; }
-keep class com.quickblox.core.rest.** { *; }
-keep class com.quickblox.core.error.** { *; }
-keep class com.quickblox.core.Query { *; }

-keep class com.quickblox.content.model.** { *; }

-keep class com.quickblox.users.parsers.** { *; }
-keep class com.quickblox.users.model.** { *; }
# quickblox sdk
-keep class com.quickblox.** { *; }

-keep class com.quickblox.messages.parsers.** { *; }
-keep class com.quickblox.messages.QBPushNotifications { *; }
-keep class com.quickblox.messages.model.** { *; }
-keep class com.quickblox.messages.services.** { *; }

-keep class com.quickblox.chat.parser.** { *; }
-keep class com.quickblox.chat.model.** { *; }

-keep class org.jivesoftware.** { *; }
# smack xmpp library
-keep class org.jxmpp.** { *; }
-keep class org.jivesoftware.** { *; }
-dontwarn org.jivesoftware.**

# webrtc
-keep class org.webrtc.** { *; }
-keep class com.quickblox.conference.** { *; }

# glide
-keep class com.bumptech.** { *; }

-dontwarn org.jivesoftware.smackx.**
# google gms
-keep class com.google.android.gms.** { *; }

#json
-keep class org.json.** { *; }
-keep class com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.reflect.TypeToken
-keep public class * implements java.lang.reflect.Type
30 changes: 23 additions & 7 deletions sample-conference-kotlin/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quickblox.sample.conference.kotlin">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />

<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<application
android:name=".App"
android:allowBackup="false"
Expand All @@ -21,6 +32,7 @@

<activity
android:name=".presentation.screens.splash.SplashActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -99,16 +111,20 @@

<service
android:name=".data.service.CallService"
android:foregroundServiceType="camera|microphone|mediaProjection"
android:launchMode="singleTask" />
android:exported="false"
android:foregroundServiceType="camera|microphone|mediaProjection" />

<service android:name=".data.push.FcmPushListenerServiceImpl">
<service
android:name=".data.push.FcmPushListenerServiceImpl"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<service android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService">
<service
android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import com.quickblox.conference.ConferenceConfig
import com.quickblox.sample.conference.kotlin.domain.user.USER_DEFAULT_PASSWORD
import dagger.hilt.android.HiltAndroidApp

//Chat settings range
// chat settings range
private const val MAX_PORT_VALUE = 65535
private const val MIN_PORT_VALUE = 1000
private const val MIN_SOCKET_TIMEOUT = 300
private const val MAX_SOCKET_TIMEOUT = 60000
private const val CHAT_PORT = 5223
private const val SOCKET_TIMEOUT = 300

//App credentials
// app credentials
private const val APPLICATION_ID = ""
private const val AUTH_KEY = ""
private const val AUTH_SECRET = ""
Expand Down Expand Up @@ -61,7 +61,7 @@ class App : Application() {
QBSettings.getInstance().init(applicationContext, APPLICATION_ID, AUTH_KEY, AUTH_SECRET)
QBSettings.getInstance().accountKey = ACCOUNT_KEY

// Uncomment and put your Api and Chat servers endpoints if you want to point the sample
// uncomment and put your Api and Chat servers endpoints if you want to point the sample
// against your own server.

// QBSettings.getInstance().setEndpoints("https://your.api.endpoint.com", "your.chat.endpoint.com", ServiceZone.PRODUCTION);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.quickblox.sample.conference.kotlin.data.call

import android.content.Context
import android.os.Handler
import android.os.Looper
import com.quickblox.conference.ConferenceClient
import com.quickblox.conference.ConferenceSession
import com.quickblox.conference.WsException
Expand All @@ -18,17 +16,13 @@ import com.quickblox.videochat.webrtc.QBRTCTypes
class CallRepositoryImpl(private val context: Context) : CallRepository {
override fun createSession(userId: Int, callback: DataCallBack<ConferenceSession, Exception>) {
val conferenceType = QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
override fun onSuccess(session: ConferenceSession) {
Handler(Looper.getMainLooper()).post {
callback.onSuccess(session, null)
}
callback.onSuccess(session, null)
}

override fun onError(exception: WsException) {
Handler(Looper.getMainLooper()).post {
callback.onError(exception)
}
callback.onError(exception)
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class NotificationRepositoryImpl(private val context: Context, private val resou
val intent = Intent(context, SplashActivity::class.java)
intent.putExtra(EXTRA_FCM_MESSAGE, message)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
var intentFlag = 0
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
intentFlag = PendingIntent.FLAG_IMMUTABLE
}
return PendingIntent.getActivity(context, 0, intent, intentFlag)
}
}
Loading

0 comments on commit 9edff1a

Please sign in to comment.