mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 20:29:10 +03:00
Fix some UP crashes
Change-Id: I16f47f86a58c23210cc99c85081da1703bbda5ac
This commit is contained in:
parent
d1379377b1
commit
38212b6410
1 changed files with 3 additions and 2 deletions
|
@ -51,6 +51,7 @@ import org.unifiedpush.android.connector.MessagingReceiver
|
|||
import org.unifiedpush.android.connector.MessagingReceiverHandler
|
||||
import timber.log.Timber
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UnifiedPushMessage(
|
||||
val notification: Notification
|
||||
)
|
||||
|
@ -117,10 +118,10 @@ val upHandler = object: MessagingReceiverHandler {
|
|||
|
||||
if (UPHelper.isEmbeddedDistributor(context)) {
|
||||
notification = moshi.adapter(Notification::class.java)
|
||||
.fromJson(message)!!
|
||||
.fromJson(message) ?: return
|
||||
} else {
|
||||
val data = moshi.adapter(UnifiedPushMessage::class.java)
|
||||
.fromJson(message)!!
|
||||
.fromJson(message) ?: return
|
||||
notification = data.notification
|
||||
notification.unread = notification.counts.unread
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue