Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(notifications): Large images are displayed when expanding notifications #2694

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.annotation.ChecksSdkIntAtLeast
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.IconCompat
import com.amplifyframework.pushnotifications.pinpoint.common.R
import java.net.URL
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -130,10 +131,15 @@ class PushNotificationsUtils(
builder.apply {
setContentTitle(payload.title)
setContentText(payload.body)
setSmallIcon(R.drawable.ic_launcher_foreground)
setSmallIcon(IconCompat.createWithBitmap(largeImageIcon))
setContentIntent(pendingIntent)
setPriority(NotificationCompat.PRIORITY_DEFAULT)
setLargeIcon(largeImageIcon)
setStyle(
NotificationCompat.BigPictureStyle()
.bigPicture(largeImageIcon)
.bigLargeIcon(null)
)
setAutoCancel(true)
}

Expand Down