All pages
Powered by GitBook
1 of 1

Loading...

Installation

iOS

1

Open your project in Xcode

Open your iOS project in Xcode and click on your project name under the targets section.

2

Locate frameworks

Scroll down in the General tab until you see the Frameworks section of the project.

3

Add the SDK

Click on the + button under Frameworks.

4

Select "Add Files…" in the bottom-left dropdown and select the Proven SDK XCFramework to add it to your project.

In order to consume the Proven mobile SDK for Android you must have access to Maven repos hosted on GitHub. Add your GitHub username and a GitHub personal access token with read permissions to your local.properties and access those values in your build.gradle.

Info for creating a personal access token can be .

Official documentation for reading values from the local.properties can be .

1

Add the below repos to your Android repository list.

2

Add the following implementation to the project dependencies in the build.gradle.kts file.

3

Make sure your AndroidManifest includes the following permissions.

You will want to add "@proven-mobile/core" and "@proven-mobile/react-native" to your project.

1

Place proven-mobile-core-v1.1.0.tgz and proven-mobile-react-native-v1.1.0.tgz in a directory parallel to your package.json.

2

In package.json add them both as dependencies.

3

Add module to dependencies in android/app/build.gradle:

Import and link package in android/app/src/main/java/com/example/MainApplication.java:

Older React Native versions (0.67.5) may need to upgrade their Gradle wrapper to 7.4 (declared in android/gradle/wrapper/gradle-wrapper.properties) and upgrade com.android.tools.build:gradle (declared in android/build.gradle) to 7.3.1.

Run:

yarn install

{% endstep %} {% endstepper %}

Older versions of React Native (0.67.5) may have trouble automatically linking the native modules. If you run into issues we recommend linking the package manually as described below.

{% stepper %} {% step %}

Add pod to ios/Podfile:

{% code title="ios/Podfile" %}

build.gradle.kts
// Example function to read values from local.properties in a build.gradle.kts file
fun readLocalProperty(key: String): String? {
    val localPropertiesFile = File(rootDir, "local.properties")
    if (localPropertiesFile.exists()) {
        val properties = Properties()
        localPropertiesFile.inputStream().use { properties.load(it) }
        return properties.getProperty(key)
    }
    return null
}

repositories {
    maven {
        setUrl("https://maven.pkg.github.com/indicio-tech/proven-mobile-sdk")
        credentials {
            username = readLocalProperty("githubUsername")
            password = readLocalProperty("githubToken")
        }
     }
    maven {
        setUrl("https://maven.pkg.github.com/hyperledger/aries-uniffi-wrappers")
        credentials {
            username = readLocalProperty("githubUsername")
            password = readLocalProperty("githubToken")
        }
    }
}
build.gradle.kts
dependencies {
    implementation("tech.indicio:provenmobile-android:1.1")
}
AndroidManifest.xml
<manifest>
    <uses-permission android:name="android.permission.  READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.  WRITE_EXTERNAL_STORAGE" />
        <!-- For Android 10 (API level 29) and above -->
    <uses-permission android:name="android.permission.  MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>
package.json
"dependencies": {
    "@proven-mobile/react-native": "file:proven-mobile-react-native-v1.1.0.tgz",
    "@proven-mobile/core": "file:proven-mobile-core-v1.1.0.tgz",
}
android/app/build.gradle
dependencies{
    <!-- Other dependencies -->
+    implementation project(":proven-mobile-react-native")
}

// If you have other libraries that use libc++_shared.so or libfbjni.so 
// you may need to add the following to your android configs
android{
    <!-- Other configs -->
+    packagingOptions {
+        pickFirst '**/libc++_shared.so'
+        pickFirst '**/libfbjni.so'
+    }
}
MainApplication.java
+ import com.rtnprovenmobilesdk.ProvenMobilePackage;

public class MainApplication extends Application implements ReactApplication {
    
    private final ReactNativeHost mReactNativeHost =
        new ReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
            return BuildConfig.DEBUG;
        }
        @Override
        protected List<ReactPackage> getPackages() {
        @SuppressWarnings("UnnecessaryLocalVariable")
        List<ReactPackage> packages = new PackageList(this).getPackages();
+       packages.add(new ProvenMobilePackage());
        return packages;
        }

Select the XCFramework

Android

Recommended: Add GitHub authentication to local.properties (or other secrets file)

Android Installation

Add repositories

Add dependency

AndroidManifest permissions

React Native

Installation

Place package files

Add dependencies to package.json

Android: app build.gradle

Android: MainApplication.java

Gradle / tooling upgrades (older RN versions)

found here
found here

Install packages

Manually link modules (If they are not getting automatically linked)

iOS: Add pod

{% endstep %}
{% endstepper %}

### Android

{% stepper %}
{% step %}
## Add repositories and confirm minSdkVersion

Add repositories to `android/build.gradle` and confirm `minSdkVersion >= 24`.

{% code title="android/build.gradle" %}
```groovy
buildscript {
    ext {
        minSdkVersion = 24
    }
}    
allprojects{
    repositories{
        maven {
            setUrl("https://maven.pkg.github.com/indicio-tech/proven-mobile-sdk")
            credentials {
                username = readLocalProperty("githubUsername")
                password = readLocalProperty("githubToken")
            }
        }
        maven {
            setUrl("https://maven.pkg.github.com/hyperledger/aries-uniffi-wrappers")
            credentials {
                username = readLocalProperty("githubUsername")
                password = readLocalProperty("githubToken")
            }
        }
    }
}
target 'ExampleApp' do
    <!-- Other configs -->
+   pod 'rtn-proven-mobile-sdk', :path => '../node_modules/@proven-mobile/react-native'

    target 'ExampleAppTests' do
        <!-- Other configs -->

Then reinstall pods.

</div>

<div data-gb-custom-block data-tag="step">

### Android: settings.gradle

Add project to `android/settings.gradle`:

<div data-gb-custom-block data-tag="code" data-title='android/settings.gradle'>

```diff
 <!-- Other configs -->
+include ':proven-mobile-react-native'
+project(':proven-mobile-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@proven-mobile/react-native/android')