there is a comment that says it is sort of outdated. I have tried to follow it but I do not see any devices in the messaging tab in backendless console. Is there any updated guide for it?
You are right about the documentation, but I am testing this on Android 5.0 and, if I remove that line, I don’t see the device registered. I will try to test in a different device to see if I get the same result.
In Headers:“android-ticker-text”:“Sample push text”,“android-content-title”:“Basic content title”,“android-content-text”:“Another context text”
I got the push in my device but I don’t see anything in the ‘Messages’ tab.
I have migrated my project from GCM to FCM. I haven’t found the updated documentation of Backendless on this subject so I have some question regarding an issue I am facing:
I am using my own PushService that extends the BackendlessPushService and I need to know how to adapt the Manifest file to take into account my receiver.
Removing the above causes the app to crash so I have replaced it with the following:
<service
android:name=“com.google.firebase.messaging.FirebaseMessagingService”>
<intent-filter>
<action android:name=“com.google.firebase.MESSAGING_EVENT”/>
</intent-filter>
</service>
<service
android:name=“com.backendless.push.BackendlessFCMService”>
<intent-filter>
<action android:name=“com.google.firebase.INSTANCE_ID_EVENT”/>
</intent-filter>
</service>
<service android:name=“fr.livelovecite.push.PushService”
android:permission=“android.permission.BIND_JOB_SERVICE”
android:exported=“false”>
</service>
No more crashes but the notification does not appear.
In the documentation com.backendless.push.BackendlessFCMService is declared as the service but nothing for com.backendless.push.BackendlessService. The app is crashing with the following stack:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: fr.livelovecite, PID: 13319
java.lang.IllegalStateException: A reference to BackendlessPushService is missing in AndroidManifest.xml. Make sure to add to the manifest file.Alternatively, if you have a custom push service implementation, make sure your class inherits from"com.backendless.push.BackendlessPushService" and is registered in the manifest fileas
at com.backendless.push.BackendlessPushService.getPushServiceClassName(BackendlessPushService.java:120)
at com.backendless.push.BackendlessPushService.enqueueWork(BackendlessPushService.java:133)
at com.backendless.push.FCMRegistration$1$1.onComplete(FCMRegistration.java:57)
at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Found the solution, adding:
<service android:name=".push.PushService"
android:permission=“android.permission.BIND_JOB_SERVICE”
android:exported=“false”>
</service>
resolves the issue of my custom service.
Nonetheless, processed notifications by BackendlessPushService override the sound of android by ignoring the sound state ( Ring, Vibrate, Silent). This means that even when on silent, received push notifications have sounds.
Firstly, please upgrade version to 5.2.1, because it has fixes for FCM.
Secondary, for FCM you shouldn’t use any service except from the documentation one.
point 2:
<service android:name=“com.backendless.push.BackendlessFCMService”>
<intent-filter> <action android:name=“com.google.firebase.MESSAGING_EVENT” /> </intent-filter> </service>
And the last one, use methods registerDevice() and unregisterDevice() intended for FCM (no for GCM)