adobe / aepsdk_flutter

Apache License 2.0
8 stars 11 forks source link

aepsdk-flutter

About this project

This repository is a monorepo. It contains a collection of Adobe Experience Platform Mobile SDK Flutter plugins listed below. These plugins can be found in the plugins directory.

Extension Package
Core (required) pub package
Assurance pub package
Edge pub package
Consent pub package
EdgeIdentity pub package
EdgeBridge pub package
UserProfile pub package
Messaging pub package

[!NOTE]
The Flutter plugins within this repository are specifically designed to support the Android and iOS platforms only.

iOS Privacy Manifest

[!IMPORTANT]
Adobe Experience Platform Flutter 4.x plugins now depend on Experience Platform iOS 5.x SDKs, which have been updated to align with Apple's latest guidelines on privacy manifest. For further details on how Apple's privacy-related announcements affect the Adobe mobile SDK for iOS, please refer to this document.

Installation

First, make sure that Flutter is installed.

Now to install the package, run:

cd MyFlutterApp
flutter pub add flutter_{plugin_name}

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  flutter_{plugin_name}: ^{latest_version}

Now import the plugin in your Dart code as follows:

import 'package:flutter_{extension}/flutter_{plugin_name}.dart'

Install instructions for each respective plugin can be found in each plugin's readme: /plugins/{plugin_name}/README.md. Start by installing flutter_aepcore which is a dependency for all other extensions.

Usage

Initializing

Initializing the SDK should be done in native code (AppDelegate / SceneDelegate for iOS and Application class for Android). Documentation for initializing the SDK can be found here. The linked documentation initalizes the User Profile extension which is not required or supported in Flutter.

As part of the initialization code, make sure that you set the SDK wrapper type to Flutter before you start the SDK.

iOS:

Add the initialization code in AppDelegate.m or AppDelegate.swift file of the generated iOS project.

Android:

Create an Application class which extends FlutterApplication and add the initialization code. Change your AndroidManifest.xml to reference this new class.

Once you have added the initialization code to your app, be sure to set the SDK wrapper type to Flutter before you start the SDK.

iOS:

Swift:

MobileCore.setWrapperType(.flutter)

Objective-C:

[AEPMobileCore setWrapperType:AEPWrapperTypeFlutter];
Android:
MobileCore.setWrapperType(WrapperType.FLUTTER);

Tests

Run:

$ cd plugins/flutter_{plugin_name}/
$ flutter test

Contributing

If you are creating a plugin for an AEP-prefix (Swift) library, please follow the steps outlined here

For all other information on contributing see Contributing

Documentation

Additional documentation about migrating from older Flutter libraries (ACP-prefixed Flutter libraries) to the latest Flutter libraries (AEP-prefixed libraries) can be found here

License

See License