EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

Adding Applozic push notification configuration firebase plugin doesn't work anymore #1752

Open HelloYouAgain opened 3 years ago

HelloYouAgain commented 3 years ago

I had firebase notifications working just fine until I added applozic chat push notification configuration. It's not throwing any error, but nativescript-plugin-firebase onMessageReceivedCallback function is not being fired anymore.

The configuration is the following https://docs.applozic.com/docs/nativescript-push-notification#push-notifications-setup

I am suspecting the first steps are the problem.

1.Download this FcmListenerService.java file from the link https://github.com/AppLozic/Applozic-Android-SDK/tree/master/app/src/main/java/com/applozic/mobicomkit/sample/pushnotification

  1. Copy the FcmListenerService.java from the above downloaded file and paste it in path /platforms/android/src/main/java/com/tns/

I tried with some changes like adding super.onMessageReceived(remoteMessage); at the end of onMessageReceived function but nothing happens.

@Override
    public void onMessageReceived(RemoteMessage remoteMessage) {

        Log.i(TAG, "Message data:" + remoteMessage.getData());

        if (remoteMessage.getData().size() > 0) {
            if (Applozic.isApplozicNotification(this,remoteMessage.getData())) {
                Log.i(TAG, "Applozic notification processed");
                return;
            }
        }

    }

Did anyone face with something similar?

I'm sorry, I know this is not a nativescript-plugin-firebase bug, but I have some hopes that the knowledge of the plugin's guts could help.

Platform: Android