mirror of
https://github.com/kickstarter/android-oss.git
synced 2026-03-13 09:11:01 +08:00
MBL-2833 Parse pledge redemption messages in MessageService for push notifs (#2428)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.kickstarter.libs
|
||||
|
||||
import android.annotation.TargetApi
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
@@ -8,7 +7,6 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Build
|
||||
import android.util.Pair
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import androidx.core.app.NotificationCompat
|
||||
@@ -245,7 +243,6 @@ class PushNotifications(
|
||||
return channels
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
private fun getNotificationChannel(
|
||||
channelId: String,
|
||||
nameResId: Int,
|
||||
|
||||
@@ -115,6 +115,11 @@ class MessageService : FirebaseMessagingService() {
|
||||
)
|
||||
)
|
||||
.survey(gson.fromJson(data["survey"], Survey::class.java))
|
||||
.pledgeRedemption(
|
||||
gson.fromJson(
|
||||
data["order"], PushNotificationEnvelope.PledgeRedemption::class.java
|
||||
)
|
||||
)
|
||||
.build()
|
||||
|
||||
Timber.d("Received message: %s", envelope.toString())
|
||||
|
||||
Reference in New Issue
Block a user