Skip to content

Instantly share code, notes, and snippets.

@imgly-gists
Last active June 2, 2017 10:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save imgly-gists/3cb6ffd562471008e3bb82c57480716b to your computer and use it in GitHub Desktop.
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>
<dependency id="cordova-plugin-compat" version="^1.0.0" />
<dependency id="cordova-plugin-add-swift-support" version="1.6.0"/>
<!-- JavaScript Interface -->
<js-module src="src/www/pesdk.js" name="PESDK">
<clobbers target="PESDK" />
</js-module>
<!-- Android -->
<platform name="android">
<config-file target="config.xml" parent="/*">
<feature name="PESDK">
<param name="android-package" value="com.photoeditorsdk.cordova.PESDKPlugin" />
<param name="onload" value="true" />
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:name="com.photoeditorsdk.cordova.CameraActivity" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</config-file>
<framework src="src/android/build.gradle" custom="true" type="gradleReference" />
<source-file src="src/android/PESDKPlugin.java" target-dir="src/com/photoeditorsdk/cordova"/>
<source-file src="src/android/CameraActivity.java" target-dir="src/com/photoeditorsdk/cordova"/>
</platform>
<!-- iOS -->
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="PESDK">
<param name="ios-package" value="PESDKPlugin" />
</feature>
</config-file>
<header-file src="src/ios/PESDKPlugin.h" />
<source-file src="src/ios/PESDKPlugin.m" />
<framework src="Photos.framework" />
<framework src="ImageIO.framework" weak="true" />
<framework src="UIKit.framework" />
<framework src="Foundation.framework" />
<framework src="QuartzCore.framework" />
<framework src="AssetsLibrary.framework" />
<framework src="MobileCoreServices.framework" />
<framework src="src/ios/PhotoEditorSDK.framework" custom="true" embed="true" />
<hook type="after_plugin_install" src="hooks/resolveDependencies.js" />
<hook type="after_platform_add" src="hooks/resolveDependencies.js" />
<!--
Cordova doesn't handle Framework embedding as it's supposed
to. Use the following workaround instead:
http://stackoverflow.com/questions/36650522/custom-cordova-plugin-add-framework-to-embedded-binaries
-->
<hook type="after_build" src="hooks/add_embedded.js" />
<!--
As we can't add plist entries using our applications
config.xml, we do it here:
-->
<config-file parent="NSCameraUsageDescription" target="*-Info.plist">
<string>Uses your camera to snap pictures.</string>
</config-file>
<config-file parent="NSPhotoLibraryUsageDescription" target="*-Info.plist">
<string>Accesses your photo library to save and open pictures.</string>
</config-file>
</platform>
<!-- Browser -->
<platform name="browser">
<config-file target="config.xml" parent="/*">
<feature name="PESDK">
<param name="browser-package" value="PESDK" />
</feature>
</config-file>
</platform>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment