flutter_aepcore 1.0.0 copy "flutter_aepcore: ^1.0.0" to clipboard
flutter_aepcore: ^1.0.0 copied to clipboard

PlatformAndroidiOS
outdated

Official Adobe Experience Platform support for Flutter apps. The Mobile Core represents the core Adobe Experience Platform SDK that is required for every app implementation.

flutter_aepcore #

pub package Build License

flutter_aepcore is a flutter plugin for the iOS and Android AEP Core SDK to allow for integration with flutter applications. Functionality to enable the Core extension is provided entirely through Dart documented below.

Contents #

Installation #

Follow the instructions found in the repository's main README

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.

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.

Core #

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

Importing Core:
import 'package:flutter_aepcore/flutter_aepcore.dart';
Getting Core version:
String version = await MobileCore.extensionVersion;
Updating the SDK configuration:
MobileCore.updateConfiguration({"key" : "value"});
Clearing configuration updates back to original configuration:
MobileCore.clearUpdatedConfiguration();
Controlling the log level of the SDK:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

MobileCore.setLogLevel(LogLevel.error);
MobileCore.setLogLevel(LogLevel.warning);
MobileCore.setLogLevel(LogLevel.debug);
MobileCore.setLogLevel(LogLevel.trace);
Getting the current privacy status:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

PrivacyStatus result;

try {
  result = await MobileCore.privacyStatus;
} on PlatformException {
  log("Failed to get privacy status");
}
Setting the privacy status:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

MobileCore.setPrivacyStatus(PrivacyStatus.opt_in);
MobileCore.setPrivacyStatus(PrivacyStatus.opt_out);
MobileCore.setPrivacyStatus(PrivacyStatus.unknown);
Getting the SDK identities:
String result = "";

try {
  result = await MobileCore.sdkIdentities;
} on PlatformException {
  log("Failed to get sdk identities");
}
Dispatching an Event Hub event:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

final Event event = Event({
  "eventName": "testEventName",
  "eventType": "testEventType",
  "eventSource": "testEventSource",
  "eventData": {"eventDataKey": "eventDataValue"}
});
try {
  await MobileCore.dispatchEvent(event);
} on PlatformException catch (e) {
  log("Failed to dispatch event '${e.message}''");
}
Dispatching an Event Hub event with callback:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

Event result;
final Event event = Event({
      "eventName": "testEventName",
      "eventType": "testEventType",
      "eventSource": "testEventSource",
      "eventData": {"eventDataKey": "eventDataValue"}
    });
    try {
      result = await MobileCore.dispatchEventWithResponseCallback(event);
    } on PlatformException catch (e) {
      log("Failed to dispatch event '${e.message}''");
    }

Identity #

For more information on the Core Identity APIs, visit the documentation here.

Importing Identity:
import 'package:flutter_aepcore/flutter_aepidentity.dart';
Getting Identity version:
String version = await Identity.extensionVersion;
Sync Identifier:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

Identity.syncIdentifier("identifierType", "identifier", MobileVisitorAuthenticationState.authenticated);
Sync Identifiers:
Identity.syncIdentifiers({"idType1":"idValue1",
                                    "idType2":"idValue2",
                                    "idType3":"idValue3"});
Sync Identifiers with Authentication State:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

Identity.syncIdentifiersWithAuthState({"idType1":"idValue1", "idType2":"idValue2", "idType3":"idValue3"}, MobileVisitorAuthenticationState.authenticated);

Note: MobileVisitorAuthenticationState is defined as:

enum MobileVisitorAuthenticationState {unknown, authenticated, logged_out}
Append visitor data to a URL:
String result = "";

try {
  result = await Identity.appendToUrl("www.myUrl.com");
} on PlatformException {
  log("Failed to append URL");
}
Setting the advertising identifier:
MobileCore.setAdvertisingIdentifier("ad-id");
Get visitor data as URL query parameter string:
String result = "";

try {
  result = await Identity.urlVariables;
} on PlatformException {
  log("Failed to get url variables");
}
Get Identifiers:
List<Identifiable> result;

try {
  result = await Identity.identifiers;
} on PlatformException {
  log("Failed to get identifiers");
}
Get Experience Cloud IDs:
String result = "";

try {
  result = await Identity.experienceCloudId;
} on PlatformException {
  log("Failed to get experienceCloudId");
}
AEPMobileVisitorId Class:
import 'package:flutter_aepcore/flutter_aepcore_data.dart';

class Identifiable {
  String get idOrigin;
  String get idType;
  String get identifier;
  MobileVisitorAuthenticationState get authenticationState;
}

Lifecycle #

For more information on the Core Lifecycle APIs, visit the documentation here

Note: It is required to implement Lifecycle in native Android and iOS code.

Signal #

For more information on the Core Signal APIs, visit the documentation here

Importing Signal:
import 'package:flutter_aepcore/flutter_aepsignal.dart';
Getting Signal version:
String version = await Signal.extensionVersion;

Tests #

Run:

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

Contributing #

See CONTRIBUTING

License #

See LICENSE

1
likes
130
pub points
94%
popularity

Publisher

verified publisheradobe.com

Official Adobe Experience Platform support for Flutter apps. The Mobile Core represents the core Adobe Experience Platform SDK that is required for every app implementation.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_aepcore