onMessageReceived isn't always called

Aperta
#372 8 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@kroikie ci sta già lavorando.

Dal 10/11/2017.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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) {
...
}
Lingua principale
Kotlin
Stelle
9.3k
Fork
7.4k
Merge medio
7g 9h
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di firebase/quickstart-android

Tutte le issue di firebase/quickstart-android

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.