- Prerequisites
- Installation
- Usage
- Running Tests
- Sample App
- Additional Cordova Plugins
- Contributing
- Licensing
On August 31, 2021, the Places Monitor extension for the Adobe Experience Platform Mobile SDKs was deprecated. Adobe no longer plans to update or support Places Monitor extension beyond August 31st.
Cordova is distributed via Node Package Management (aka - npm
).
In order to install and build Cordova applications you will need to have Node.js
installed. Install Node.js.
Once Node.js is installed, you can install the Cordova framework from terminal:
sudo npm install -g cordova
To start using the Places Monitor plugin for Cordova, navigate to the directory of your Cordova app and install the plugin:
cordova plugin add https://github.com/adobe/cordova-acpplacesmonitor.git
Check out the documentation for help with APIs
ACPPlacesMonitor.extensionVersion(function(version){
console.log(version);
}, function(error){
console.log(error);
});
Within the App's application:didFinishLaunchingWithOptions, register the SDK extensions:
#import "ACPCore.h"
#import "ACPPlaces.h"
#import "ACPPlacesMonitor.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
[ACPCore configureWithAppId:@"yourAppId"];
[ACPPlaces registerExtension]; //Register Places with Core
[ACPPlacesMonitor registerExtension]; //Register PlacesMonitor with Core
[ACPCore start: nil];
return YES;
}
The following updates are also neccessary for Places Monitor on iOS:
- Enable location updates in the background
- Add the keys NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription to the app's plist file
Within the App's OnCreate method, register the SDK extensions and start the Places Monitor:
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Places;
import com.adobe.marketing.mobile.PlacesMonitor;
public class MobileApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
MobileCore.ConfigureWithAppId("yourAppId");
try {
Places.registerExtension(); //Register Places with Core
PlacesMonitor.registerExtension(); //Register PlacesMonitor with Core
MobileCore.start(null);
} catch (Exception e) {
//Log the exception
}
}
}
The following update is also neccessary for Places Monitor on Android:
// start the places monitor when the device ready event is heard
document.addEventListener("deviceready", function () {
ACPPlacesMonitor.start(function(response) {
console.log("Successfully started the Places Monitor.");
}, function(error){
console.log(error);
});
}, function (error) {
console.log(error);
});
var clearPlacesData = true;
ACPPlacesMonitor.stop(clearPlacesData, function(response) {
console.log("Successfully stopped the Places Monitor.");
}, function(error){
console.log(error);
});
ACPPlacesMonitor.updateLocation(function(response) {
console.log("Successfully updated the location.");
}, function(error){
console.log(error);
});
ACPPlacesMonitor.setRequestLocationPermission(ACPPlacesMonitor.LocationPermissionAlwaysAllow, function(response) {
console.log("Successfully set the location permission request.");
}, function(error){
console.log(error);
});
ACPPlacesMonitor.setPlacesMonitorMode(ACPPlacesMonitor.MonitorModeContinuous, function(response) {
console.log("Successfully set the places monitor mode.");
}, function(error){
console.log(error);
});
Install cordova-paramedic https://github.com/apache/cordova-paramedic
npm install -g cordova-paramedic
Run the tests
cordova-paramedic --platform ios --plugin . --verbose
cordova-paramedic --platform android --plugin . --verbose
A Cordova app for testing the Adobe SDK plugins is located at https://github.com/adobe/cordova-acpsample. The app is configured for both iOS and Android platforms.
Below is a list of additional Cordova plugins from the AEP SDK suite:
Extension | GitHub | npm |
---|---|---|
Core SDK | https://github.com/adobe/cordova-acpcore | |
Adobe Analytics | https://github.com/adobe/cordova-acpanalytics | |
Places | https://github.com/adobe/cordova-acpplaces | |
Project Griffon (Beta) | https://github.com/adobe/cordova-acpgriffon | |
User Profile | https://github.com/adobe/cordova-acpuserprofile |
Looking to contribute to this project? Please review our Contributing guidelines prior to opening a pull request.
We look forward to working with you!
This project is licensed under the Apache V2 License. See LICENSE for more information.