Push notifications

Enable push notifications in your app using the MAUI SDK

Engagement enables sending push notifications to your app users using scenarios. The mobile application handles the push message using the SDK and renders the notification on the customer's device.

Push notifications can also be silent, used only to update the app’s interface or trigger some background task.

📘

Refer to Mobile push notifications to learn how to create push notifications in the Engagement web app.

📘

Also see Mobile push notifications FAQ at Bloomreach Support Help Center.

Integration

The Flutter SDK relies on the underlying native Android and iOS platforms to handle push notifications.

The following pages describe the steps for each platform to add the minimum push notification functionality (receive alert notifications) to your app.

Customization

This section describes the customizations you can implement once you have integrated the minimum push notification functionality.

Respond to push notification interactions

Once you have followed the integration steps for each platform, your app should be able to receive push notifications.

To respond to a push notification interaction, you can set up a listener using BloomreachSDK.SetOpenedPushCallback():

Bloomreach.BloomreachSDK.SetOpenedPushCallback(action =>
{
    switch (action.ActionType)
    {
        case "app":
            // last push directed user to your app with no link
            // log data defined on Bloomreach backend
            Console.WriteLine(action.Attributes);
            break;
        case "deeplink":
            // last push directed user to your app with deeplink
            Console.WriteLine(action.Url);
            break;
        case "web":
            // last push directed user to web, nothing to do here
            Console.WriteLine(action.Url);
            break;
    }
});

We recommend registering the listener as soon as possible to ensure proper application flow. However, the SDK will hold the last push notification and call the listener once it's registered.

Respond to received push notifications

You can set up a listener for received push notifications using BloomreachSDK.SetReceivedPushCallback, which is especially useful for silent push notifications.

Bloomreach.BloomreachSDK.SetReceivedPushCallback(payload =>
{
    foreach (var entry in payload.RawData)
    {
        Console.WriteLine($"Push Extra: {entry.Key} : {entry.Value} ");
    }
});

We recommend registering the listener as soon as possible to ensure proper application flow. However, the SDK will hold the last push notification and call the listener once it's registered.