[PAID] ๐Ÿ› ๏ธ FcmPush : Firebase Cloud Messaging push notifications: device tokens, topics, tray notifications, tap handling, and optional HTTP v1 sending.

FcmPush

[PAID] :heavy_dollar_sign: :hammer_and_wrench: FcmPush

Firebase Cloud Messaging push notifications: device tokens, topics, tray notifications, tap handling, and optional HTTP v1 sending.

Open store


:clipboard: Extension specifications

Package in.sarthakdev.fcmpush
Version 1.0
Price $7.99 USD
Category Tools
Updated 23 September 2026
Platforms MIT App Inventor, Kodular, Niotron, Android Builder, Thunkable
Built using FAST
Store FcmPush for App Inventor | SarthakDev.in

Paid buyers get this AIX by email after checkout. Import it from Projects โ†’ Import extension.

:open_book: About

Firebase Cloud Messaging on the device: tokens, topics, tray notifications, tap handling, and sending. Set ApiKey, ApplicationId and ProjectId (or paste google-services.json). Set ServiceAccountJson too if this app should send, then call Initialize. SendToToken and SendToTopic use that key. Keep the service account in an admin app you control.

:sparkles: Features

  • Official Firebase Messaging SDK, configured at runtime โ€” no google-services Gradle plugin
  • Initialize from designer keys or the full google-services.json text
  • Service account is checked during Initialize, then SendToToken and SendToTopic use it
  • Device token, token refresh, and delete
  • Subscribe and unsubscribe to topics
  • Tray notifications in the foreground and for data messages while the app is closed
  • NotificationOpened when the user taps a push, including messages Android drew in the background
  • Android 13 notification permission block
  • Optional HTTP v1 send to a token or a topic from an admin app
  • Android 5.0 (API 21) or newer

:test_tube: Example

Import FcmPush, drag it onto the screen, then add TokenLabel, MessageLabel, SubscribeButton, SendButton, and a Notifier. The blocks below are the receive app and the admin send app.

  • ApiKey, ApplicationId, and ProjectId come from google-services.json. SenderId can stay empty; it is read from ApplicationId.
  • AutoInitialize is on, so Initialized fires after the screen starts once those three are filled in.
  • Leave ServiceAccountJson empty on the app that only receives.
  • Paste the service account JSON into ServiceAccountJson only on an admin app you control. Initialize checks it, then SendToToken and SendToTopic can send. Anyone who extracts that key can message your users.

Receive

Screen.Initialize asks for notification permission. Initialized calls GetToken, and GotToken writes the token into TokenLabel. Save that token if you want to message this phone later. MessageReceived shows the title and body. NotificationOpened does the same when someone taps the tray notification. SubscribeButton joins the topic news. ErrorOccurred shows why a block failed.

Send

Put this in the admin app, with ServiceAccountJson set. SendButton pushes to the topic news and attaches a small data dictionary. MessageSent fires when FCM accepts it. Phones subscribed to news then run MessageReceived.

App Inventor blocks for receiving an FcmPush message and sending one to the news topic

๐Ÿงฉ Blocks

FcmPush blocks

๐Ÿ”” Events

Initialized

Firebase is ready. Call GetToken to receive. If ServiceAccountJson was set, SendToToken and SendToTopic are ready too.

Initialized

Got Token

The device token. Save it on your server or database to send pushes to this device.

GotToken

  • token (text)

Token Refreshed

Firebase issued a new token (first launch, reinstall, or rotation). Update it on your server.

TokenRefreshed

  • token (text)

Token Deleted

The token was deleted.

TokenDeleted

Topic Subscribed

The device is subscribed to the topic.

TopicSubscribed

  • topic (text)

Topic Unsubscribed

The device is unsubscribed from the topic.

TopicUnsubscribed

  • topic (text)

Permission Result

Result of RequestNotificationPermission.

PermissionResult

  • granted (boolean)

Message Received

A push arrived. data is a dictionary of the message's data keys. whileClosed is true for data messages that arrived while no screen was open and are delivered now.

MessageReceived

  • messageId (text)
  • from (text)
  • title (text)
  • body (text)
  • data (dictionary)
  • whileClosed (boolean)

Notification Opened

The user tapped a push notification and the app opened. title and body are empty for notifications Android drew while the app was in the background; data is always filled.

NotificationOpened

  • messageId (text)
  • title (text)
  • body (text)
  • data (dictionary)

Message Sent

FCM accepted the message. messageName looks like projects/PROJECT/messages/MESSAGE.

MessageSent

  • messageName (text)

Error Occurred

Something failed. action is the block that failed; message says why.

ErrorOccurred

  • action (text)
  • message (text)
๐Ÿ”ง Methods

Initialize

Start Firebase for receiving, and for sending when ServiceAccountJson is set. Fires Initialized.

Initialize

Initialize From Json

Start Firebase from the full text of google-services.json. Picks the client that matches this app's package name, else the first Android client.

InitializeFromJson

  • googleServicesJson (text)

Get Token

Fetch this device's FCM registration token. Fires GotToken.

GetToken

Delete Token

Delete this device's token. The device stops receiving pushes until GetToken is called again. Fires TokenDeleted.

DeleteToken

Subscribe To Topic

Subscribe this device to a topic (letters, numbers, - _ . ~ %). Fires TopicSubscribed.

SubscribeToTopic

  • topic (text)

Unsubscribe From Topic

Unsubscribe this device from a topic. Fires TopicUnsubscribed.

UnsubscribeFromTopic

  • topic (text)

Request Notification Permission

Ask for the Android 13+ notification permission. On older Android this returns granted right away. Fires PermissionResult.

RequestNotificationPermission

Notifications Enabled

True if this app is allowed to show notifications right now.

NotificationsEnabled

Returns boolean.

Show Notification

Show a local tray notification now. data is a dictionary or JSON text (or empty) and is returned in NotificationOpened when tapped.

ShowNotification

  • title (text)
  • body (text)
  • data (any)

Clear Notifications

Remove every notification this app has shown.

ClearNotifications

Send To Token

Send a push to one device token with the service account from Initialize. Fires MessageSent.

SendToToken

  • token (text)
  • title (text)
  • body (text)
  • data (any)

Send To Topic

Send a push to every device subscribed to a topic with the service account from Initialize. Fires MessageSent.

SendToTopic

  • topic (text)
  • title (text)
  • body (text)
  • data (any)
โš™๏ธ Properties

Api Key

Web API key from google-services.json (client > api_key > current_key). Starts with AIza.

ApiKey

Type: text

Application Id

Firebase Android app id from google-services.json (mobilesdk_app_id), like 1:1234567890:android:abc123.

ApplicationId

Type: text

Project Id

Firebase project id from google-services.json (project_info > project_id).

ProjectId

Type: text

Sender Id

Optional. Project number / sender id (project_info > project_number). Read from ApplicationId when blank.

SenderId

Type: text

Auto Initialize

Call Initialize automatically after Screen.Initialize when ApiKey, ApplicationId and ProjectId are set.

AutoInitialize

Type: boolean ยท Default: true

Show Notification When Open

Show a tray notification even while the app is open. MessageReceived fires either way.

ShowNotificationWhenOpen

Type: boolean ยท Default: true

Show Data Notifications

For data-only messages that contain title/body keys, show a tray notification (also when the app is closed).

ShowDataNotifications

Type: boolean ยท Default: true

Use App Icon

Use the app icon as the small notification icon. Off uses a white Android chat glyph, which renders cleanly on every launcher.

UseAppIcon

Type: boolean ยท Default: false

Channel Name

Name of the notification channel shown in Android settings (Android 8+).

ChannelName

Type: text ยท Default: Notifications

Service Account Json

Firebase service account key JSON, used to send. Checked during Initialize. Leave empty on apps that only receive. Only put this in an admin app you control โ€” anyone who extracts it can send to your users.

ServiceAccountJson

Type: text

Send As Data Message

When on, SendToToken / SendToTopic put title and body inside data so MessageReceived fires even when the receiving app is in the background.

SendAsDataMessage

Type: boolean ยท Default: false

Token

Last FCM registration token seen on this device, or empty.

Token

Type: text

Is Initialized

True after Initialize succeeded.

IsInitialized

Type: boolean


:shopping_cart: Get the AIX

Paid extension. Buy it on the store, then import from Projects โ†’ Import extension.


Built by Sarthak Gupta ยท hi@sarthakdev.in ยท sarthakdev.in

1 Like