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 .
Add the below repos to your Android repository list.
Add the following implementation to the project dependencies in the build.gradle.kts file.
Make sure your AndroidManifest includes the following permissions.
You will want to add "@proven-mobile/core" and "@proven-mobile/react-native" to your project.
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.
In package.json add them both as dependencies.
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" %}
// 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")
}
}
}dependencies {
implementation("tech.indicio:provenmobile-android:1.1")
}<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>"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",
}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'
+ }
}+ 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;
}{% 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')