1.Introduction
Description: Using this extension you can send and receive Push Notifications with Firebase Cloud Messaging (FCM) latest SDK (23.3.0).
Latest Version: 1.1
Released: October 30, 2023
Last Updated: October 30, 2023
Aix size: 497 kb
2. Blocks




3. Docs
MessageReceived | Event raised when message is received. No notification is shown for messages.data | dictionary |
NotificationReceived | Event raised when notification is received while app is in foreground. A notification is shown to user in system tray.id | text title | text body | text data | dictionary |
SubscribeSuccessful | Event raised if subscribe was successfultopic | text |
UnsubscribeSuccessful | Event raised if unsubscribe was successfultopic | text |
ErrorOccurred | Event raised whenever an error occurrs. Most of the methods raise this event in case of error.errorMsg | text |
GotToken | Event raised after getting FCM tokentoken | text |
NotificationSent | Event raised after notification has been sent to FCM serversuccessful | boolean response | dictionary |
MessageSent | Event raised after message has been sent to FCM serversuccessful | boolean response | dictionary |
GotData | Event raised when current screen has been opened by clicking notification. This event is raised automatically.data | dictionary |
AskNotificationPermission | Asks notification permission which is required on Android 13 and above |
ClearNotification | Clear notification from system trayid | number |
Init | Initialize Firebase Messaging Client with provided credentials. You need to call this method only once and then extension will auto init client itself.projectId | text apiKey | text appId | text senderId | text |
IsInitialized | Returns whether FCM has been initialized or not |
Subscribe | Subscribe to given topic to receive notificationstopic | text |
RegisterForNotifClick | Registers screen which will be opened when user clicks on notification which is shown while app is in foreground. Notifications which are shown when app is not opened, will always open Screen1.screen | text startValue | text |
RetrieveData | Retrieve notification’s data which opened current screen.Response is Dictionary. |
Unsubscribe | Unsubscribe from the given topictopic | text |
GetToken | Gets user’s FCM token which can be used to send individual notifications |
SendNotificationToTopic | Send notification to topic. ‘largeIcon’ argument is optional.topic | text serverKey | text title | text body | text largeIcon | text data | dictionary |
SendMessageToTopic | Send message to topic.topic | text serverKey | text data | dictionary |
SendNotificationToTokens | Send notification to token(s)tokens | list serverKey | text title | text body | text largeIcon | text data | dictionary |
SendMessageToTokens | Send message to tokenstokens | list serverKey | text data | dictionary |
SendCustomNotification | Send notification or message with given json contentserverKey | text jsonNotif | text |
Importance | Sets importance of notification channel Property Type : write-only Accepts : text |
SoundOn | Sets whether to enable sound for notification channel or not Property Type : write-only Accepts : boolean |
SmallIcon | Sets small icon shown in notification. If not specified then app’s icon is shown. Property Type : write-only Accepts : text |
4. Usages
First initialize FCM Client. You need to call Init method once and next time it would be auto initialized.
Ask for notification permission
Required on Android 13 and above
Now subscribe to a topic

If subscription was successful then you can send a notification/message to users who have subscribed to topic

Server key is located at Project Settings > Cloud Messaging
Enabled legacy version from GCloud console to obtain it.
You can send notifications/messages to token(s) also

User receives notifications and clicks on it
There can be two scenarios here:-
- App in foreground ie. being used by user
Notification will open registered screen.
GotData
even will be raised upon screen initialization if screen opened through notification.

You can obtain data from RetrieveData
method also.
- App not opened by user.
Notification click will open Screen1 always andGotData
event will be raised.
Retrieve all received messages

5. Purchase the extension
Please include your email address in payment note or just contact me after payment to get aix and related files.
6. Demo

7. Updates
ChangeLog Version 1.2
- Added
ClearNotification
block - Added feature to store all messages in Tiny DB with tag as timestamp
Set namespace toFCM_DATA
to retrieve those messages - Fixed inconsistency in
SendNotificationToTokens
andSendMessageToTokens
blocks - Some internal changes to make future improvements easier to adapt
8. Tutorials
Setup video:
Thank you.
Hope it helps!