flutter_aepuserprofile
flutter_aepuserprofile
is a flutter plugin for the iOS and Android Adobe Experience Platform UserProfile SDK to allow for integration with Flutter applications. Functionality to enable the UserProfile extension is provided entirely through Dart documented below.
Installation
First, make sure that the flutter_aepcore plugin is installed, as flutter_aepuserprofile depends on it.
Install instructions for this package can be found here.
Note: After you have installed the SDK, don't forget to run
pod install
in yourios
directory to link the libraries to your Xcode project.
Tests
Run:
flutter test
Usage
UserProfile
For more detailed information on the UserProfile APIs, visit the documentation here
Registering the extension with AEPCore:
Note: It is required to initialize the SDK via native code inside your AppDelegate and MainApplication for iOS and Android respectively.
As part of the initialization code, make sure that you set the SDK wrapper type to Flutter
before you start the SDK.
Refer to the Initialization section of the root README for more information about initializing the SDK.
Importing the SDK:
import 'package:flutter_aepuserprofile/flutter_aepuserprofile.dart';
Getting UserProfile version:
String version = await UserProfile.extensionVersion;
Get user profile attributes which match the provided keys:
try {
String userAttributes = await UserProfile.getUserAttributes(["attr1", "attr2"]);
} on PlatformException {
log("Failed to get the user attributes");
}
Remove provided user profile attributes if they exist:
UserProfile.removeUserAttributes(["attr1", "attr2"]);
Set multiple user profile attributes:
UserProfile.updateUserAttributes({"attr1": "attr1Value", "attr2": "attr2Value"});
Contributing
See CONTRIBUTING
License
See LICENSE