android 6.0.1 (Galaxy Note 5) Push notification vi

2019-07-28 05:10发布

问题:

After searching for an answer for few weeks now, came across countless dissections – no one offered a solution or even identified the problem (or change)

https://github.com/firebase/quickstart-android/issues/89

https://github.com/firebase/quickstart-android/issues/100

https://github.com/firebase/quickstart-android/issues/88

https://code.google.com/p/android/issues/detail?id=219084

Push notifications are delayed in Android Doze mode

We’re developing a calling app, We need to send a push notification to wake up the target device, load our app to the foreground (activity intent, disabling screen lock), start ringing and waiting for user action.

Galaxy Note 5 running Android 6.0.1 does not waking up after entering idle/Doze mode.

  • when the device is not in idle mode, the push arrive successfully.
  • On all other devices I have it works fine. (also running android 6.0.1- not samsung)

We’re sending only “data” json object/ tag (no “notification” object/ tag)

As i can see it's a repetitive issue, i followed all answers no success:

  1. Did anyone experience this problem with devices running android 6.0.1?

  2. Is there a definite answer to this issue? or is it a samsung bug? (i posted the question to samsung support as well)

Thanks for all helpers

Details: Android studio: 2.1.2

top gradle:

dependencies {
    classpath 'com.google.gms:google-services:3.0.0'
    }

app gradle:

compile "com.google.firebase:firebase-messaging:9.4.0"
apply plugin: 'com.google.gms.google-services'
targetSdkVersion 23

app manifest:

<service android:name="com.example.mypackage.GcmIntentService" >
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</service>

Server:

$fields = array(
       'registration_ids' => $registrationIDs,
         'priority' => ‘high’,
         'collapse_key' => 'Updates available',

         'data' => array(
             'Alert' => $message,
            'Type' => $type ,
            'Title' =>  $title ,
            ),

         'time_to_live' => 0
        );

回答1:

The problem is resolved. I changed nothing. But the google-service-play apk installed on the device was automatically updated on August 23rd. ever since the app wakes up at any time. I guess I need to thank google.