onMessageReceived isn't always called

Ouverte
#372 8 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@kroikie y travaille déjà.

Depuis le 10/11/2017.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

api: messaging
  • Android device: Multiple devices
  • Android OS version: Multiple OS versions
  • Google Play Services version:
  • Firebase/Play Services SDK version: 11.4.2

The onMessageReceived method is only called for about 2/3 of the users. It's not because it's in the background because it's a data payload sent from Microsoft Azure, and the method is called for me and the notification displayed when I have the app closed. I know they're reaching the device because I checked the Play Console and they're marked as 'Acknowledged'.

Steps to reproduce:
  1. Follow the quickstart example and log the onMessageReceived call
  2. Send a message with a data payload
  3. See how many of your push notifications are logged
Observed Results:

Only about 2/3 of the notifications end up with a call to onMessageReceived.

Expected Results:

I expected all of the notifications to reach onMessageReceived.

Relevant Code:
 <service
 android:name=".push.MyFirebaseMessagingService">
     <intent-filter>
         <action android:name="com.google.firebase.MESSAGING_EVENT"/>
     </intent-filter>
 </service>
public class MyFirebaseMessagingService extends FirebaseMessagingService {

...
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
...
}
Langage dominant
Kotlin
Étoiles
9.3k
Forks
7.4k
Merge moyen
7 j 9 h
PR mergées (30 j)
6

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de firebase/quickstart-android

Toutes les issues de firebase/quickstart-android

Issues similaires

Plus d'issues Kotlin

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.