2024 Feb 07 10:11 AM
Let me just get straight to the topic. We have successfully implemented a powerful notification system using Build Apps capabilities combined with FCM (Firebase Cloud Messaging). However, we have hit a roadblock while working on a specific use case for displaying a custom value as an app icon badge both for IOS and Android.
Why?
As far as we could notice SAP Build Apps does not expose any options to set the app badge with a logic node or custom code, or system variable. Which causes us to hit limitations.
We tried to rely on the default behavior of the operating systems and managed to sort of work around the issue for IOS, as IOS has a "badge" key in the Apple Push Notification Service message object.
Similarly android also has a "notification_count" key in the Push object, but the Android operating system doesn't override the previous badge value, rather than sums the previous value and the currently received up. Which is definitely not the behavior we aim to.
What have we achieved so far?
1. Android device receives a push notification that is displayed in the notification center and the badge is increased by 1.
2. User clears the notification from the notification center --> badge count is reduced by the number of notifications that the user has cleared.
Based on Android and FCM documentation the way how to customize the badge and notification center behaviour is all possible, but on the client side. There are quite a few react-native libraries as well, that are dedicated to achieving this goal.
When the user opens the app, the notifications are not cleared from the center, and the badge is not updated. Is there any way how we could implement some badge count customization, custom javascript, or anything? Any help is greatly appreciated.
---
PS. There seems to be a slight issue with the notification icon not being right in the final build. We still see the SAP Build Apps icon (AG icon) in the notification center, though the image assets seem to be our apps' icons. But we'll have to check it again, as soon as the build service is up and running again.