ARRIVED TWO NOTIFICATION AND NOT ONE, duplicated!
See original GitHub issueHi, i have a problem with FCM! when i send a notification, two notification arrive to my mobile and not one, how? this is my code:
this.notificationListener = FCM.on(FCMEvent.Notification, async notif => { this.setState({my_noty: notif}) if(notif.opened_from_tray){ console.log('OPEN') FCM.setBadgeNumber(0); this.FirebaseConnect(notif); } FCM.setBadgeNumber(1); this.FirebaseConnect(notif); }); }
componentWillUnmount() { this.notificationListener.remove(); }
in AndroidManifest.xml:
`<service android:name="com.evollu.react.fcm.MessagingService" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT"/> </intent-filter> </service>
<service android:name="com.evollu.react.fcm.InstanceIdService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>`
Please help!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
i found the problem!, this is in AndroidManifest.xml, the notifications is duplicate because i have this lines that receive the notification and also has FCM
<!-- <receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="${applicationId}" /> </intent-filter> </receiver> -->
i removed this and now arrive only a one notification, thanks.
try reproduce with example project