Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
/ flutter-acpplaces Public archive

Adobe Experience Platform Places support for Flutter apps.

License

Notifications You must be signed in to change notification settings

adobe/flutter-acpplaces

flutter_acpplaces

Notice of deprecation

Since April 25, 2023, Apple has required apps submitted to the App Store to be built with Xcode 14.1 or later. The Experience Platform Mobile SDKs and extensions outlined below were built with prior versions of Xcode and are no longer compatible with iOS and iPadOS given Apple’s current App Store requirements. Consequently, on August 31, 2023, Adobe will be deprecating support for the following Experience Platform Mobile SDKs and wrapper extensions:

After August 31, 2023, applications already submitted to the App Store that contain these SDKs and wrapper extensions will continue to operate, however, Adobe will not be providing security updates or bug fixes, and these SDKs and wrapper extensions will be provided as-is exclusive of any warranty, due to the App Store policy outlined above.

We encourage all customers to migrate to the latest Adobe Experience Platform versions of the Mobile SDK to ensure continued compatibility and support. Documentation for the latest versions of the Adobe Experience Platform Mobile SDKs can be found here. The iOS migration guide can be found here.


pub package Build License

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.

Installation

Install instructions for this package can be found here.

Note: After you have installed the SDK, don't forget to run pod install in your ios directory to link the libraries to your Xcode project.

Tests

Run:

flutter test

Usage

Importing the SDK:
import 'package:flutter_acpplaces/flutter_acpplaces.dart';
Getting the SDK version:
String version = await FlutterACPPlaces.extensionVersion;
Registering the extension with ACPCore:

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.

iOS

Swift

import ACPPlaces

ACPPlaces.registerExtension()

Objective-C

#import "ACPPlaces.h"

[ACPPlaces registerExtension];
Android:
import com.adobe.marketing.mobile.Places;

Places.registerExtension();
Clear client side Places plugin data:
try {
  await FlutterACPPlaces.clear;
} on PlatformException {
  log("Failed to clear Places data.");
}
Get the current POI's that the device is currently known to be within:
String pois;
try {
  pois = await FlutterACPPlaces.currentPointsOfInterest;
} on PlatformException {
  log("Failed to get the current POI's.");
}
Get the last latitude and longitude stored in the Places plugin:
String location;
try {
  location = await FlutterACPPlaces.lastKnownLocation;
} on PlatformException {
  log("Failed to get the last known location.");
}
Get a list of nearby POI's:
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.");
}
Pass a Geofence and transition type to be processed by the Places plugin:
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);
Set the authorization status:
FlutterACPPlaces.setAuthorizationStatus(ACPPlacesAuthorizationStatus.ALWAYS);

Contributing

See CONTRIBUTING

License

See LICENSE