react-native-mixpanel icon indicating copy to clipboard operation
react-native-mixpanel copied to clipboard

Remote push notification icon not showing

Open ikhattab opened this issue 4 years ago • 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?

ikhattab avatar Apr 02 '20 10:04 ikhattab

Hey @ikhattab, I experienced something similar and managed to fix it. More details here: https://github.com/davodesign84/react-native-mixpanel/issues/229

SMJ93 avatar May 18 '20 15:05 SMJ93

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

CrnogoracIvan avatar May 27 '20 14:05 CrnogoracIvan

Thanks folks for your help totally appreciated 👍

ikhattab avatar May 27 '20 14:05 ikhattab