Skip to content

onMessageRecieved not working when app is killed. Any solution? #822

Closed
@KORuL

Description

@KORuL

Step 1: Describe your environment

  • Android device: Meizu M1 Note
  • Android OS version: 5.1
  • Google Play Services version: com.google.gms:google-services:4.2.0
  • Firebase/Play Services SDK version:
    implementation 'com.google.firebase:firebase-core:16.0.7'
//    implementation 'com.google.firebase:firebase-iid:17.1.0'
    implementation 'com.google.firebase:firebase-messaging:17.4.0'
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
    implementation 'com.google.firebase:firebase-functions:16.1.3'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.google.firebase:firebase-database:16.0.6'
    implementation 'com.google.firebase:firebase-crash:16.2.1'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.gms:google-services:4.2.0'
  

Step 2: Describe the problem:

Almost all phones are fine. But in some phone (Meizu M1 note):

onMessageRecieved not working when app is killed in some devices. It works perfect in foreground and in background. But when app is killed I don t receive notification in system tray, or call onMessageRecieved .

I send only DATA (to, data) notification. What I do wrong?

I read #4 , #89 , #86 , #368 , #365 , #337 , #205 , #96 , #20 , #4, #151 , #816 did not find the answer.

I get a strange error in logcat W/GCM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=net.korul.hbbft (has extras) }

I made this receiver - but it did not help

<receiver
            android:name=".MyBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="net.korul.hbbft" />
            </intent-filter>
        </receiver>

AndroidManifest contains:

        <service android:name=".services.MyFirebaseMessagingService"
                 android:permission="true"
                 ndroid:stopWithTask="false">
            <intent-filter>
                <action android:name="com.google.firebase. MESSAGING_EVENT"/>
            </intent-filter>
        </service>

MyFirebaseMessagingService - is standart from snippset

Steps to reproduce:

  1. Minimize and swipe out your application
  2. Send FCM notification
  3. You can see the below log but notification doesn't trigge

Observed Results:

W/GCM: broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=net.korul.hbbft (has extras) }

Expected Results:

Should get the notification

Relevant Code:

I read all the branches dedicated to this issue, do not refer to them! The problem is, she is over 2 years old! Need a solution!

I also tried to send a push message with the firebase console, and it does not come - the exact same error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions