Skip to content

Instantly share code, notes, and snippets.

var PESDK = {
present: function(success, failure, options) {
cordova.exec(success, failure, "PESDK", "present", [options]);
}
};
module.exports = PESDK;
private Runnable present(final Activity mainActivity, final String filepath, final CallbackContext callbackContext) {
callback = callbackContext;
final PESDKPlugin self = this;
return new Runnable() {
public void run() {
if (mainActivity != null) {
SettingsList settingsList = new SettingsList();
settingsList
.getSettingsModel(EditorLoadSettings.class)
.setImageSourcePath(filepath.replace("file://", ""), true) // Load with delete protection true!
- (void)present:(CDVInvokedUrlCommand *)command {
if (self.lastCommand == nil) {
self.lastCommand = command;
PESDKConfiguration *configuration = [[PESDKConfiguration alloc] initWithBuilder:^(PESDKConfigurationBuilder * _Nonnull builder) {
// Customize the SDK to match your requirements:
// ...eg.:
// [builder setBackgroundColor:[UIColor whiteColor]];
}];
@imgly-gists
imgly-gists / plugin.xml
Last active June 2, 2017 10:59
PhotoEditor SDK Cordova plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:rim="http://www.blackberry.com/ns/widgets"
id="cordova-plugin-pesdk" version="1.1.0">
<name>PESDK</name>
<description>PhotoEditor SDK Cordova Plugin</description>
<license>Apache 2.0</license>
<keywords>cordova,camera</keywords>
<repo>https://github.com/imgly/pesdk-cordova-demo.git</repo>