question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ARRIVED TWO NOTIFICATION AND NOT ONE, duplicated!

See original GitHub issue

Hi, 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>`

foto

Please help!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Brhernanncommented, Dec 26, 2017

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.

0reactions
evollucommented, Dec 25, 2017

try reproduce with example project

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting duplicate notifications in the action center.
Ever since installing Windows 10 I've been getting duplicate notifications in the action center. As in, two notifications for one 'action'.
Read more >
Solved: Duplicate notification triggering some time - ServiceNow
Solved: Hello, We got an issue in the PROD in which duplicate notification triggering some time. I am using this notifcation and workflow....
Read more >
Stop duplicate chat notifications - Android - Google Chat Help
To avoid duplicate notifications, you can turn off notifications for the Google Chat app on your mobile device. On your mobile device, open...
Read more >
Receiving duplicate notification for the same message when ...
When signal lock is enabled, duplicate notifications. A notification is sent when the new message arrives AND when signal is unlocked AND when ......
Read more >
Duplicated Notifications - OneSignal Documentation
Web Push: Duplicate notifications happen when you add the OneSignal App ID to 2+ different origins and subscribe to those origins. An origin...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found