BeaconPushNotificationsProcessor

Processes push notifications from Firebase Cloud Messaging (FCM) for the Beacon SDK.

This processor is used when your application already handles FCM push messaging. It allows you to identify and process Beacon-specific notifications within your existing FCM infrastructure.

Usage:

  1. In your FirebaseMessagingService.onMessageReceived(), check if the message is for Beacon using isBeaconNotification
  2. If it is a Beacon notification, call process to display the notification

Example:

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    if (remoteMessage.getData().size() > 0) {
        BeaconPushNotificationsProcessor processor = new BeaconPushNotificationsProcessor();
        if (BeaconPushNotificationsProcessor.isBeaconNotification(remoteMessage.getData())) {
            processor.process(this, remoteMessage.getData());
        } else {
            // Handle your own push messages
        }
    }
}

Constructors

Link copied to clipboard
constructor()
Constructs a new BeaconPushNotificationsProcessor without specific BeaconPreferences.
constructor(prefs: BeaconPreferences)
Constructs a new BeaconPushNotificationsProcessor with the provided BeaconPreferences.

Functions

Link copied to clipboard
Checks if the provided FCM payload is a Beacon-specific notification.
Link copied to clipboard
open fun process(context: Context, data: Map<String, String>): Boolean
Allows Beacon to process a push notification message, typically by displaying a system notification.