Push Notification with Firebase and Unity

0 votes
Hi! I've setup my app for push notifications through Firebase (only Android app, for now).

All the configuration is done: the FCM legacy key is set up, the user is subscribed for push notifications, the user's device ID for notifications  (in the App42 console) is the token received from Firebase, etc.

When sending push notifications from the Firebase console, everything's working perfectly. The problem is that notifications sent via App42 (either from the console OR from code) are never shown. When the app is opened, Firebase shows me that I got a new message, but there is no notification attached to it (I assume this could be the problem).

What am I doing wrong, please advise.

Best Regards,

Alex.
asked May 8, 2018 in Unity by Ez Entertainment (10 points)

1 Answer

0 votes

Hello Alex,

Could you please add me(demo@shephertz.com) as a collaborator to your app in AppHQ Management console?

To add collaborator, go to App Manager -> Collaborator -> Add Collaborator and provide above email address.

It will help us to understand the problem in better way.

Thanks.

 

 

answered May 9, 2018 by rajeev.etc (1,660 points)
It's done, you're now a collaborator.
I just checked server logs for your app and it says sent successfully. Could you please share your app APK file so that I can install on my device and test.
Yes, the messages are being sent, they are being received in the app. The problem is that there are no notifications shown, ever. Again, this happens only when sending from App42, when sending from Firebase, the notification is also shown.

I have sent the apk ("test.apk") to you via wetransfer.

Thanks for your time,
Alex.
Hi Alex,
Are you using our Android Push Plugin? If not then it might be a problem of push payload parsing and displaying logic inside the app. Please use our push plugin(https://github.com/shephertz/App42-Android-Push-Sample) to solve it.
Please let me know if this is not the case. Also, I did not received your apk. Please send it to support@shephertz.com.

Thanks.
Hi again! Sorry for the delay, we got a little sidetracked with another project. I've re-sent the APK to your support address via wetransfer.com.

I've recreated the project from scratch using the push plugin and App42-Unity3D-SDK-4.1.2.dll; still no notifications. When the app is running, messages are received. When the app is stopped, however, instead of the notification, we get the Android "App has crashed" message.

We are using Unity 2018.1.0f2. Android version is 8.0.0

Thanks,
Alex.
Hi Alex,

Greetings from ShepHertz !!

Will you please share the created Project you are using for Unity Android Push Notification, so that we can trace the exact problem you are facing.

You can also go through with Unity Push Android Sample available on Git.
https://github.com/shephertz/App42_Push_Sample_Unity
I have sent you the APK, as was previously requested, did you receive it?
Do you want me to send you the entire Unity Project now?

Alex.
Yes, We received the Application but if you share the sample project then it will be help us to trace the exact problem.
Ok, I have sent the archive of the test project.

Thank you,
Alex.
Hi!

Any news? Did you receive the project's archive?

Best Regards,
Alex.
Yes, I have received the project. I will look into it and update you asap.
Hi Alex,
I have tested with the test app you have shared, available in project. I will be able to receive notification whether application is in forground or iin background.
Will you please share the logcat logs that can help us to trace the problem, why application is crashing.
Hi Vishnu,
What about when the application is closed; do you see notifications when the app is closed? We are also able to receive messages, as well, when the app is in the foreground or background. But when the app is completely stopped, there are no push notifications.
Also, what Android version are you using for testing? We are testing on two devices with Android 8.1.0 & 8.0.0 and it does not work on either.
Hi Alex,

If application is completely stopped, it will also terminates the GCM service that is responsible for Push Notification and you will not be able to receive Push Notification.

I have tested the same on Android version 7+.

As you have mentioned that your application is being crashed, Please share the log cat logs so that we can trace the problem and provide you the solution.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...