question

Kirk avatar image
Kirk asked

Android Push Notification not coming in as Notification, just as Data in system tray

I'm attempting to get notifications in the system tray with AdvancedPlatformDelivery without luck.

I have them working if I use Package object, but I want to be able to use the collapse_key feature as well.

I've read the following and setup my json object passed in the AdvancedPlatformDelivery.Json field. It send / received the message, but doesn't come up in the system tray on android if the app is closed, or in the background. It will deliver the message as soon as I open/bring to foreground the app manually.

https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidConfig

I specifically need help implementing the collapse_key feature on android. I'm using the Firebase system upgrade. What am I missing? Thank you.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kirk avatar image Kirk commented ·

@SethDu App is scheduled for release mid April, so we have some time..
With respect to using FCM APIs, It's a possibility I'll have to look into, although I'm not sure of the impact with respect to our current integration of PlayFab and Photon with our use of the push notification system, as it's being used to invite/gather people into photon multiplayer rooms.
Thank you for the quick response.Looking forward to your updates

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

We support three types of push notification, which are Messages, Packages, AdvancedPlatformDelivery. I have tested all of them and reproduced your issue. Somehow I cannot receive AdvancedPlatformDelivery in background or when app is killed. I will dig into it later.

If you are specifically in need of collapsed key in your client app, I think the work around solution for now is NOT using PlayFab push notification implementation and instead, using FCM APIs completely. Anyway, I will keep this thread updated after I double check this issue with my team.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kirk avatar image Kirk commented ·

Thank you for the quick response.. We also want to handle click_action and deep linking, which all require the AdvancedPlatformDelivery.Json. App is scheduled for release mid April, so we have a little time.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Kirk commented ·

I have done more tests on AdvancedPlatformDelivery and some Log sentences have been added in onMessageReceived function to monitor the messages. It seems that no matter the app is in foreground or in background, the function does receive the JSON string in AdvancedPlatformDelivery (be aware of the format). However, as we have discovered before, it doesn't show the notification and I think it will be fine to manually craft a notification according to: https://developer.android.com/guide/topics/ui/notifiers/notifications.

on my Android studio Logcat:

0 Likes 0 ·
Kirk avatar image Kirk Seth Du ♦ commented ·

As per https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidNotification

The json should contain the 'android' key with the AndroidConfig object value. The AndroidConfig object has values I need to utilize: 'collapse_key', 'priority', 'ttl', 'restricted_package_name', 'data, and the 'notification' key with the AndroidNotification object value. The AndroidNotification object has the 'click_action' key I need to utilize.

Please test these features, and if they're not working, please attempt to get them working, or at least determine why they are not working. Is it an FCM issue or a SNS issue, or a PlayFab issue?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.