How to add and remove Android notification channels in Delphi Rio10.3.2


I would like to implement multiple notification channels for Android on an FMX project.

RAD 10.3.2 now provides some support for API >= 26 and a “fallback” notification channel is automatically created. Its default description is “Notification channel for Firebase” and I would like to change this description as well as to add some new channels.

In RAD 10.3.2, the new Options/Application/Services parameters provide a “Default local notification channel Id” which, I suppose, is there to change the value of the fcm_fallback_notification_channel_label stored in the Strings.xml file generated when building or deploying the App.

However, when I write an Id like “Infos” in this field, this has no effect on the generated Strings.xml file content.
I’ve thus copied the Strings.xml file in another directory, edited it manually and modified the deployment in order to use this file rather than the automatic one.
This is working if I uninstall the App and reinstall it with the changed channel description. The final user may now see the correct name of the channel.

However, I’ve still got only one channel and I don’t know how to add more ones.
I’ve searched in the Android support and I see that the channels are supposed to be added via notificationManager.createNotificationChannel(channel) in the starting code of an App.
However, I’ve found no access to these method in TPushService or TPushServiceConnection. Is there a “standard” way in Delphi for adding and removing notification channels ?

Comments are closed.