Skip to content

Commit

Permalink
SDK v0.17.1 (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
pallab-gain-tt authored Mar 26, 2024
1 parent 387e90f commit e5e877f
Show file tree
Hide file tree
Showing 16 changed files with 154 additions and 7 deletions.
Binary file added com/ninchat/sdk/0.17.1/sdk-0.17.1.aar
Binary file not shown.
1 change: 1 addition & 0 deletions com/ninchat/sdk/0.17.1/sdk-0.17.1.aar.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f73d4a48bc0d348024b508c4d1497113
1 change: 1 addition & 0 deletions com/ninchat/sdk/0.17.1/sdk-0.17.1.aar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b9bf82c175d900cec7e46384f6e7aed7d3b5c58a
107 changes: 107 additions & 0 deletions com/ninchat/sdk/0.17.1/sdk-0.17.1.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ninchat</groupId>
<artifactId>sdk</artifactId>
<version>0.17.1</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-android-extensions-runtime</artifactId>
<version>1.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ninchat</groupId>
<artifactId>client</artifactId>
<version>1.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.android.material</groupId>
<artifactId>material</artifactId>
<version>1.2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>androidx.recyclerview</groupId>
<artifactId>recyclerview</artifactId>
<version>1.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>androidx.localbroadcastmanager</groupId>
<artifactId>localbroadcastmanager</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.bumptech.glide</groupId>
<artifactId>glide</artifactId>
<version>4.11.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.greenrobot</groupId>
<artifactId>eventbus</artifactId>
<version>3.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxandroid</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxkotlin</artifactId>
<version>3.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>androidx.core</groupId>
<artifactId>core-ktx</artifactId>
<version>1.3.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>androidx.appcompat</groupId>
<artifactId>appcompat</artifactId>
<version>1.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<version>1.3.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-android</artifactId>
<version>1.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.airbnb.android</groupId>
<artifactId>paris</artifactId>
<version>1.7.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ninchat</groupId>
<artifactId>libwebrtc</artifactId>
<version>106.0.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
1 change: 1 addition & 0 deletions com/ninchat/sdk/0.17.1/sdk-0.17.1.pom.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e0b9501b21bcf3cf8da27f90e769f258
1 change: 1 addition & 0 deletions com/ninchat/sdk/0.17.1/sdk-0.17.1.pom.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5be668a0f2db576c7a33dee66f35513661a3fb2e
5 changes: 3 additions & 2 deletions com/ninchat/sdk/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>com.ninchat</groupId>
<artifactId>sdk</artifactId>
<versioning>
<release>0.17.0</release>
<release>0.17.1</release>
<versions>
<version>0.0.6</version>
<version>0.0.7</version>
Expand Down Expand Up @@ -85,7 +85,8 @@
<version>0.16.3</version>
<version>0.16.4</version>
<version>0.17.0</version>
<version>0.17.1</version>
</versions>
<lastUpdated>20240227134827</lastUpdated>
<lastUpdated>20240326072650</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion com/ninchat/sdk/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
486fa5735239513ce13332a4772caf61
47a837b410561b3e8afecbed6bf5041a
2 changes: 1 addition & 1 deletion com/ninchat/sdk/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cafabf4ee6a1abbbe2492550e968dfe1c200fa03
b3e0d2a4bf04bdc1ecf5921e00c159c044fc1b62
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ public void onSessionInitFailed() {} // TODO: Add error types
public void onSessionEvent(final Props params) {}
public void onEvent(final Props params, final Payload payload) {}
public void onSessionError(final Exception error) {}
public void onActivityDropped() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ public String getChatStarted() {
}

public void close() {
if(ninchatState != null) {
ninchatState.setPendingSessionState(Misc.SESSION_CLOSING);
}

if (ninchatSessionHolder != null) {
ninchatSessionHolder.dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,18 @@ class NinchatSessionHolder(ninchatState: NinchatState) {
listener: NinchatSDKEventListener?
) {
currentSession = session
session.setOnClose { Log.v(TAG, "onClose") }
session.setOnConnState { state -> Log.v(TAG, "onConnState: $state") }
session.setOnClose {
ninchatState.pendingSessionState = Misc.SESSION_CLOSED;
Log.v(TAG, "onClose")
}
session.setOnConnState { state ->
Log.v(TAG, "onConnState: $state")
ninchatState.pendingSessionState = when (state) {
"connected", "connecting" -> Misc.SESSION_OPENED
"disconnected" -> Misc.SESSION_CLOSED
else -> ninchatState.pendingSessionState
}
}
session.setOnLog { msg -> Log.v(TAG, "onLog: $msg") }

session.setOnSessionEvent { params: Props ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.ninchat.sdk.ninchatquestionnaire.helper.NinchatQuestionnaireConstants
import com.ninchat.sdk.ninchatquestionnaire.ninchatquestionnaireactivity.presenter.NinchatQuestionnairePresenter
import com.ninchat.sdk.ninchatqueue.model.NinchatQueueModel
import com.ninchat.sdk.ninchatqueue.presenter.NinchatQueuePresenter
import com.ninchat.sdk.utils.misc.Misc
import com.ninchat.sdk.utils.misc.Misc.Companion.toRichText


Expand Down Expand Up @@ -108,6 +109,15 @@ class NinchatActivityPresenter(
}


fun maybeDisposeSession() {
NinchatSessionManager.getInstance()?.let { ninchatSessionManager ->
if(ninchatSessionManager.ninchatState?.pendingSessionState == Misc.SESSION_OPENED) {
ninchatSessionManager.eventListenerWeakReference?.get()?.onActivityDropped();
}
ninchatSessionManager.close()
}
}

var queuesUpdatedReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val action = intent.action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.ninchat.sdk.ninchatactivity.presenter.NinchatActivityPresenter
import com.ninchat.sdk.ninchatquestionnaire.ninchatquestionnaireactivity.model.NinchatQuestionnaireModel
import com.ninchat.sdk.ninchatquestionnaire.ninchatquestionnaireactivity.presenter.NinchatQuestionnairePresenter
import com.ninchat.sdk.ninchatqueue.model.NinchatQueueModel
import com.ninchat.sdk.utils.misc.Misc
import kotlinx.android.synthetic.main.activity_ninchat.*

class NinchatActivity : NinchatBaseActivity(), INinchatActivityPresenter {
Expand Down Expand Up @@ -72,11 +73,15 @@ class NinchatActivity : NinchatBaseActivity(), INinchatActivityPresenter {
}

override fun onDestroy() {
ninchatActivityPresenter.maybeDisposeSession()
ninchatActivityPresenter.unSubscribeBroadcaster()
super.onDestroy()
}

fun onCloseClick(view: View?) {
NinchatSessionManager.getInstance()?.ninchatState?.let { state ->
state.pendingSessionState = Misc.SESSION_CLOSING
}
setResult(RESULT_CANCELED)
finish()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class NinchatState {
var requestCode: Int = 0
var queueId: String? = null
var currentSessionState: Int = Misc.NEW_SESSION
var pendingSessionState = Misc.SESSION_CLOSED;

var userChannels: Props? = null
var userQueues: Props? = null
Expand Down Expand Up @@ -112,6 +113,7 @@ class NinchatState {
isGroupVideoChannel = false
queueId = null
currentSessionState = Misc.NEW_SESSION
pendingSessionState = Misc.SESSION_CLOSED
userChannels = null
userQueues = null
audienceMetadata?.remove()
Expand Down
5 changes: 4 additions & 1 deletion ninchatsdk/src/main/java/com/ninchat/sdk/utils/misc/Misc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class Misc {
const val NEW_SESSION = 0
const val IN_QUEUE = 2
const val HAS_CHANNEL = 3
const val NONE = 4
const val SESSION_CLOSING = 4
const val SESSION_CLOSED = 5
const val SESSION_OPENED = 6
const val NONE = 7

@JvmStatic
fun center(text: String?): String {
Expand Down

0 comments on commit e5e877f

Please sign in to comment.