davide-scalzo/react-native-mixpanel

Remote push notification icon not showing

Opened this issue · 3 comments

Hello,

I'm using firebase with MixPanel to manage push notification on Android, I made all configuration and all is working, I can receive a notification on android but it's always comes with the default Android icon (grey circle one) I tried to set different one like so:

<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_stat_ic_notification" />
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/white" />

to check if my configuration is correct I sent a notification from firebase and the icon I set in AndroidManifest.xml was shown correctly, so it seems it has something to do with MixPanel.

I have a setup where I'm using product flavor and I followed what's in documentation to set the Resource package name

<meta-data android:name="com.mixpanel.android.MPConfig.ResourcePackageName" android:value="${applicationId}" />

but still, icon not showing, any clue what I've missed here?

SMJ93 commented

Hey @ikhattab, I experienced something similar and managed to fix it. More details here: #229

As @SMJ93 mention his part of code works. Still those are missing parts:

  • instead of import io.invertase.firebase.messaging.RNFirebaseMessagingService; insert import io.invertase.firebase.messaging.ReactNativeFirebaseMessagingService;
  • Into AndroidManifets add:
     <service android:name=".PushNotificationService">
          <intent-filter>
              <action android:name="com.google.firebase.MESSAGING_EVENT"/>
          </intent-filter>
      </service>
  • Add ic_notification icon to drawable folder
  • If you want transparent color replace color intent with intent.putExtra("mp_color", "#00FFFFFF") in PushNotificationService

Thanks folks for your help totally appreciated 👍