flutter_acpplaces
is a flutter plugin for the iOS and Android AEP Places SDK to allow for integration with flutter applications. Functionality to enable the Places 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_acpplaces/flutter_acpplaces.dart';
String version = await FlutterACPPlaces.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 ACPPlaces
ACPPlaces.registerExtension()
Objective-C
#import "ACPPlaces.h"
[ACPPlaces registerExtension];
import com.adobe.marketing.mobile.Places;
Places.registerExtension();
try {
await FlutterACPPlaces.clear;
} on PlatformException {
log("Failed to clear Places data.");
}
String pois;
try {
pois = await FlutterACPPlaces.currentPointsOfInterest;
} on PlatformException {
log("Failed to get the current POI's.");
}
String location;
try {
location = await FlutterACPPlaces.lastKnownLocation;
} on PlatformException {
log("Failed to get the last known location.");
}
String pois;
try {
var location = {'latitude':37.3309422, 'longitude': -121.8939077};
pois = await FlutterACPPlaces.getNearbyPointsOfInterest(location, 100);
} on PlatformException {
log("Failed to get the nearby POI's.");
}
var geofence = new Geofence({'requestId':'d4e72ade-0400-4280-9bfe-8ba7553a6444', 'latitude':37.3309422, 'longitude': -121.8939077, 'radius': 1000, 'expirationDuration':-1});
FlutterACPPlaces.processGeofence(geofence, ACPPlacesRegionEventType.ENTRY);
FlutterACPPlaces.setAuthorizationStatus(ACPPlacesAuthorizationStatus.ALWAYS);
See CONTRIBUTING
See LICENSE