# Receiving Notifications

Firebase Cloud Messaging allows you to send push notifications to your users directly from your app. Firebase Messaging is not integrated directly into the package. This allows developers to gain full control over the message handling logic, including support for custom backends, multiple message sources, or environment-specific configurations (e.g., via flavors).

Using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user reengagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.

INFO

If you don’t have FCM integrated with your app yet you have to configure Push Notification by visiting Firebase documentation. (opens new window)


# Register FCM Token updates

SDK allows to pass token in two ways:

# On App initialization

Standard way to pass FCM Token to User.com is to do it using SDK initialize(); method. This approach requires you to ensure Firebase is initialized and Token is available before calling User.com SDK.

await UserComSDK.instance.initialize(
    mobileSdkKey: 'paste_your_key_from_user_com',
    appDomain: 'app_domain_is_base_url',
    fcmToken: token,
);	

# Custom

You can initialize SDK without a Token and pass it at other time using setFcmToken(); method. It will register FCM Token on a currently Tracked User.

await UserComSDK.instance.setFcmToken(token);

# Next step

Implement Notifications:

Read more about Notifications usage: