Fix notification icon

This commit is contained in:
Robbie Trencheny 2019-12-12 17:11:23 -08:00
parent 20cc710490
commit 42d380589f
No known key found for this signature in database
GPG key ID: 1E236BB235BF0021
7 changed files with 4 additions and 2 deletions

View file

@ -54,7 +54,7 @@
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_launcher_foreground" />
android:resource="@drawable/ic_stat_ic_notification" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorPrimary" />

View file

@ -9,6 +9,7 @@ import android.media.RingtoneManager
import android.os.Build
import android.util.Log
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import io.homeassistant.companion.android.BuildConfig
@ -77,7 +78,8 @@ class MessagingService : FirebaseMessagingService() {
val channelId = "default"
val defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
val notificationBuilder = NotificationCompat.Builder(this, channelId)
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setSmallIcon(R.drawable.ic_stat_ic_notification)
.setColor(ContextCompat.getColor(this, R.color.colorPrimary))
.setContentTitle(messageTitle)
.setContentText(messageBody)
.setAutoCancel(true)

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB