flutter_aepmessaging 5.0.0 copy "flutter_aepmessaging: ^5.0.0" to clipboard
flutter_aepmessaging: ^5.0.0 copied to clipboard

Official Adobe Experience Platform support for Flutter apps. The Experience Platform Messaging extension enables handling of user push an in-app messages from a mobile app when using the Adobe Experie [...]

flutter_aepmessaging #

pub package Build License

flutter_aepmessaging is a flutter plugin for the iOS and Android AEPMessaging SDK to allow for integration with Flutter applications. Functionality to enable the Messaging extension is provided entirely through Dart documented below.

Prerequisites #

The Adobe Experience Platform Messaging extension has the following peer dependency, which must be installed prior to installing it:

Installation #

Install instructions for this package can be found here.

Note: After you have installed the SDK, don't forget to run pod install in your ios directory to link the libraries to your Xcode project.

Usage #

For more detailed information on the Messaging APIs, visit the documentation here

Importing the extension: #

In your Flutter application, import the Messaging extension as follows:

import 'package:flutter_aepmessaging/flutter_aepmessaging.dart';
copied to clipboard

Initializing with SDK: #

To initialize the SDK, use the following methods:

Refer to the root Readme for more information about the SDK setup.

API reference #

extensionVersion #

Returns the SDK version of the Messaging extension.

Syntax

static Future<String> get extensionVersion
copied to clipboard

Example

String version = await Messaging.extensionVersion;
copied to clipboard

getCachedMessages #

Returns a list of messages that have currently been cached in-memory using Messaging.saveMessage()

Syntax

List<Message> messages = await Messaging.getCachedMessages();
copied to clipboard

refreshInAppMessages #

This API retrieves the Experience Cloud ID (ECID) that was generated when the app was initially launched. This ID is preserved between app upgrades, is saved and restored during the standard application backup process, and is removed at uninstall.

Syntax

static Future<void> refreshInAppMessages
copied to clipboard

Example

await Messaging.refreshInAppMessages();
copied to clipboard

Handling In App Messages using Message Object #

Note: In order to use the methods defined in the Message class, use getCachedMessages to retrieve the messages that have been cached in-memory, and then use the Message objects returned.

The Message object passed to the MessagingDelegate contains the following functions to handle a message:

show #

Signals to the UIService that the message should be displayed.

Syntax

show()
copied to clipboard

Example

Message message
message.show()
copied to clipboard

dismiss #

Signals to the UIService that the message should be dismissed.

Syntax

dismiss(((suppressAutoTrack: ?boolean) = false))
copied to clipboard

Example

Message message
message.dismiss(true)
copied to clipboard

track #

Generates an Edge Event for the provided interaction and event type.

Syntax

track(String interaction, MessagingEdgeEventType eventType)
copied to clipboard

Example

Message message;
message.track("sample text", MessagingEdgeEventType.IN_APP_DISMISS)
copied to clipboard

setAutoTrack #

Enables/Disables auto-tracking for message events.

Syntax

setAutoTrack(Bool autoTrack)
copied to clipboard

Example

Message message;
message.setAutoTrack(true)
copied to clipboard

clear #

Clears the reference to the in-memory cached Message object. This function must be called if a message was saved by calling shouldSaveMessage but no longer needed. Failure to call this function leads to memory leaks.

Syntax

clear()
copied to clipboard

Example

Message message
message.clear()
copied to clipboard

Push Notification Setup #

Handling push notifications must be done in native (Android/iOS) code for the Flutter app. To configure push notifications in the native project, follow the instructions provided for their respective platforms:

Push Messaging APIs usage #

The AEPMessaging extension's push messaging APIs must be called from the native Android/iOS project of Flutter app.

iOS API usage
Android API usage

In Android, MessagingPushPayload can be used for getting the notification attributes like title, body, and action. These are useful for push notification creation.

Tests #

Run:

flutter test
copied to clipboard

Contributing #

See CONTRIBUTING

License #

See LICENSE

1
likes
130
points
9.73k
downloads

Publisher

verified publisheradobe.com

Weekly Downloads

2024.09.13 - 2025.03.28

Official Adobe Experience Platform support for Flutter apps. The Experience Platform Messaging extension enables handling of user push an in-app messages from a mobile app when using the Adobe Experience Platform SDK.

Homepage
Repository (GitHub)
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, flutter_aepcore

More

Packages that depend on flutter_aepmessaging