flutter_acpanalytics
is a flutter plugin for the iOS and Android AEP Analytics SDK to allow for integration with flutter applications. Functionality to enable the Analytics extension is provided entirely through Dart documented below.
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.
Run:
flutter test
import 'package:flutter_acpanalytics/flutter_acpanalytics.dart';
String version = await FlutterACPAnalytics.extensionVersion;
Note: It is required to initialize the SDK via native code inside your AppDelegate and MainApplication for iOS and Android respectively. For more information see how to initialize Core.
Swift
import ACPAnalytics
ACPAnalytics.registerExtension()
Objective-C
#import "ACPAnalytics.h"
[ACPAnalytics registerExtension];
import com.adobe.marketing.mobile.Analytics;
Analytics.registerExtension();
String trackingId;
try {
trackingId = await FlutterACPAnalytics.trackingIdentifier;
} on PlatformException {
log("Failed to get the tracking identifier");
}
FlutterACPAnalytics.sendQueuedHits();
int queueSize;
try {
queueSize = await FlutterACPAnalytics.queueSize;
} on PlatformException {
log("Failed to get the queue size");
}
FlutterACPAnalytics.clearQueue();
FlutterACPAnalytics.setVisitorIdentifier("vid");
String visitorId;
try {
visitorId = await FlutterACPAnalytics.visitorIdentifier;
} on PlatformException {
visitorId = "Failed to get the visitor identifier";
}
FlutterACPCore.trackAction("myAction", data: {"key1": "value1"});
FlutterACPCore.trackState("myState", data: {"key1": "value1"});
See CONTRIBUTING
See LICENSE