fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 991 forks source link

onNotification event not fired #628

Open Ahmed-Abdelftah opened 4 years ago

Ahmed-Abdelftah commented 4 years ago

I am trying to handle firebase push notification in my app , i can get token successfully also notification sent successfully when app is in background or closed, but when app is in foreground no thing happened. I am listening on onNotification event but it never fired , neither when app is on foreground nor when notification is clicked, any help would be very appreciated.

hungtranqn commented 4 years ago

Same issue. Any solution ? Thanks.

rahul-maurya1992 commented 4 years ago

I'm facing the same issue. is there any contributor who can tell us what's happening in the new version? I have tried to downgrade the plugin but because gradle and google services updated there policies and version it's not installing.

bendspoons commented 4 years ago

If on Android, check if those lines are present in your AndroidManifest.xml

 <activity android:exported="true" android:launchMode="singleTop" android:name="com.gae.scaffolder.plugin.FCMPluginActivity">
      <intent-filter>
        <action android:name="FCM_PLUGIN_ACTIVITY"/>
        <category android:name="android.intent.category.DEFAULT"/>
      </intent-filter>
    </activity>
    <service android:name="com.gae.scaffolder.plugin.MyFirebaseMessagingService">
      <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT"/>
      </intent-filter>
    </service>
    <service android:name="com.gae.scaffolder.plugin.MyFirebaseInstanceIDService">
      <intent-filter>
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
      </intent-filter>
    </service>
ragcsalo commented 2 years ago

Same for me on iOS...