A working project can be found in the the example app.
No npm package yet...
npm install react-native-image-tools@https://github.com/npomfret/react-native-image-tools.git --save
react-native link react-native-image-tools
(Optional) Get your Adobe ID key (client id, secret key and redirect url) for the Abode Creative SDK from abobe.io. It will work without it, but you will get a pop up warning when the image editor is launched. Before releasing your app you will need to submit your app to Adobe for review.
(official docs here)
- Download the Adobe Creative SDK for iOS.
- Create a folder called
Frameworks
at the root of your iOS project and copy AdobeCreativeSDKImage.framework and AdobeCreativeSDKCore.framework to it - in xCode:
- under General > Embeded Binaries, click +, click Add Other, browse to the frameworks directory and add them both
- under Build Settings > Framework Search Paths add
$(PROJECT_DIR)/Frameworks
- under Build Phases > click +, click New Run Script Phase (note that the order of the build phases is crucial; this Run Script phase must come after the Embed Frameworks phase), add this text:
${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/AdobeCreativeSDKCore.framework/strip-frameworks.sh
- clean and build
(official docs here)
-
Import Modules to
settings.gradle
:... include ':react-native-image-tools' project(':react-native-image-tools').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-tools/android') ...
-
Add some maven repos to your root level
build.gradle
:
allprojects {
repositories {
...
maven {
url 'https://repo.adobe.com/nexus/content/repositories/releases/'
}
maven {
url 'http://maven.localytics.com/public'
}
...
}
}
- To your app
build.gradle
, add the following:
android {
...
defaultConfig {
...
manifestPlaceholders = [appPackageName: "${applicationId}"]
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
dependencies {
compile 'com.android.support:multidex:1.0.3'
implementation fileTree(dir: "libs", include: ["*.jar"])
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
}
configurations.all {
exclude group: 'com.android.support', module: 'support-v13'
}
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile project(':react-native-image-tools')
...
}
}
- To your
MainApplication.java
add:
...
import com.pomocorp.rnimagetools.RNImageToolsPackage;
import com.adobe.creativesdk.foundation.AdobeCSDKFoundation;
import com.adobe.creativesdk.foundation.auth.IAdobeAuthClientCredentials;
...
//add IAdobeAuthClientCredentials to the implements list
public class MainApplication extends Application implements ReactApplication, IAdobeAuthClientCredentials {
...
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
...
new RNImageToolsPackage()
...
);
}
@Override
public void onCreate() {
...
MultiDex.install(getBaseContext()); // oppotional, for some case this might cause an error
AdobeCSDKFoundation.initializeCSDKFoundation(getApplicationContext());
...
}
@Override
public String getClientID() {
return "your client id here";
}
@Override
public String getClientSecret() {
return "your client secret here";
}
@Override
public String getRedirectURI() {
return "your client redirect here";
}
@Override
public String[] getAdditionalScopesList() {
return new String[]{"email", "profile", "address"};
}
}
- Add both AsyncTaskCompat.java & AsyncTaskCompatHoneycomb.java to your android/app/src/main/java/com/yourproject/