Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemilla committed Sep 8, 2023
1 parent a160efe commit 0ec08a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencyResolutionManagement {

```gradle
dependencies {
implementation 'com.github.trycourier:courier-android:2.0.2'
implementation 'com.github.trycourier:courier-android:2.0.3'
}
```

Expand Down
11 changes: 1 addition & 10 deletions android/src/main/java/com/courier/android/Courier.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
package com.courier.android

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Lifecycle
import com.courier.android.models.CourierAgent
import com.courier.android.models.CourierException
import com.courier.android.modules.*
import com.courier.android.modules.CoreAuth
import com.courier.android.modules.CoreInbox
import com.courier.android.modules.CoreLogging
import com.courier.android.modules.CorePush
import com.courier.android.utils.NotificationEventBus
import com.google.firebase.FirebaseApp
import com.google.firebase.messaging.RemoteMessage
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.collectLatest

/**
Expand Down Expand Up @@ -54,7 +45,7 @@ class Courier private constructor(internal val context: Context) {
companion object {

var USER_AGENT = CourierAgent.NATIVE_ANDROID
internal const val VERSION = "2.0.2"
internal const val VERSION = "2.0.3"
internal const val TAG = "Courier SDK"
internal const val COURIER_PENDING_NOTIFICATION_KEY = "courier_pending_notification_key"
internal val eventBus by lazy { NotificationEventBus() }
Expand Down
16 changes: 12 additions & 4 deletions android/src/main/java/com/courier/android/modules/CoreInbox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal class CoreInbox : DefaultLifecycleObserver {
private val brandsRepo by lazy { BrandsRepository() }

private var listeners: MutableList<CourierInboxListener> = mutableListOf()
private var inbox: Inbox? = null
internal var inbox: Inbox? = null

internal var brandId: String? = null
internal val brand: CourierBrand? get() = inbox?.brand
Expand Down Expand Up @@ -571,11 +571,19 @@ fun Courier.readAllInboxMessages(onSuccess: () -> Unit, onFailure: (Exception) -
}
}

fun Courier.readMessage(messageId: String) {
inbox.inbox?.readMessage(messageId)
}

fun Courier.unreadMessage(messageId: String) {
inbox.inbox?.unreadMessage(messageId)
}

/**
* Internal Classes
*/

private data class Inbox(
internal data class Inbox(
var messages: MutableList<InboxMessage>?,
var totalCount: Int,
var unreadCount: Int,
Expand Down Expand Up @@ -692,12 +700,12 @@ private data class Inbox(

}

private data class ReadAllOperation(
internal data class ReadAllOperation(
val messages: MutableList<InboxMessage>?,
val unreadCount: Int,
)

private data class UpdateOperation(
internal data class UpdateOperation(
val index: Int,
val unreadCount: Int,
val message: InboxMessage,
Expand Down

0 comments on commit 0ec08a3

Please sign in to comment.