Get Started

digi.me React-Native demo Quick Start Guide

Get sample projects up and running quickly using TypeScript and native digi.me SDKs. The React-Native demo is pre-configured and ready to be compiled and run with little configuration required. Please contact us first to obtain credentials for your application.

Min Requirements

• ImageMagicK
• Node JS
• Yarn package manager

For Android development

• Android Studio 3.2.0+
• Any Android device with Android 5.0 and above
• Development environment to support Android API 21+
• JDK 1.8.181+
• digi.me and a library installed on the Android device

For iOS development

• Cocoapods
• iOS 11+
• iPhone 5, iPad (4th generation), or iPad mini (2nd generation)
• Registered Apple developer account
• Swift 4 or higher
• XCode 9 or higher
• digi.me and a library installed on the iOS device

New to TypeScript?

Please see the TypeScript quick start documentation for help on building a web application and other resources.

Get started

1. Clone the demo app

The React-Native demo code repository is stored under GitHub. Clone the repository to your machine to get the demo app. Run the following command in the terminal;

git clone https://github.com/digime/digime-react-native-demo.git

2. Install dependencies

For first run, run the following command to install the required dependencies;

yarn install

If developing for iOS, please ensure that the following command to is run next. This pulls down the required Cocoapod dependencies, installs any required React-Native dependencies, and also attempts to fix various issues that may occur during the iOS build process;

yarn install-ios

3. Configure the app

A demo contract ID and p12 file have already been embedded in for ease of use. The contract selects both Social and Finance data from a digi.me library for a given time period (please contact us if you would like to use a different contract). Set your application ID and p12 password in /constants/Constants.ts as shown from the placeholders below:

export class Constants {
    public static readonly APPLICATION_NAME: string = "[YOUR APPLICATION_NAME]";
    public static readonly APPLICATION_ID: string = 
"[YOUR APPLICATION_ID]"
; public static readonly CONTRACT_ID: string = "gzqYsbQ1V1XROWjmqiFLcH2AF1jvcKcg"; public static readonly P12_PASSPHRASE: string =
"[YOUR P12_PASSWORD]"
; public static readonly P12_FILENAME: string = "CA_RSA_PRIVATE_KEY"; public static readonly P12_EXTENSION: string = ".p12"; public static readonly ARGON_URL: string = "https://api.digi.me"; }

4. Build and set native project variables

The React-Native demo embeds both the Android and iOS native digi.me SDKs. In order to set the variables to the native projects, the TypeScript must first be compiled to JavaScript using command below. Please note that this needs to be run each time there are any TypeScript changes.

yarn compile

Then, the following command is required in order to create the native Android and iOS images and assets, but also to set the variables from Constants.js. Please note that `configure native` only needs to be run when there are changes to Constants.ts or any additions to the ./assets directory.

yarn configure-native

5. Run on your device

Run the app then create a digi.me library to use with CA. Connect your device, then run the following command (platform dependent);

Android:

yarn run-android

iOS:

yarn run-ios

6. Make it your own

Explore the code! Use the demo app as a base or start a new project. For more information about the React-Native demo please check out our GitHub React-Native Demo documentation.

digi.me Android Quick Start Guide

Get sample projects up and running quickly! The sample project included with the SDK is pre-configured and ready to be compiled and run with little configuration required. Please contact us first to obtain credentials for your application.

Min Requirements

• JDK 1.8.181+
• Android Studio 3.2.0+. Please try to use only the production builds avoiding preview builds such as Canary or Beta as these may have features that aren't yet supported in the digi.me Android SDK or the example app project
• Development environment to support Android API 21+
• Any Android device with Android 5.0 and above
• digi.me and a library installed on the Android device

New to Android?

Please see the Android developer guide for help on building apps and other resources.

Get started with the example app

1. Clone the example app with the SDK

Download digi.me SDK with a few example apps to try. The digi.me SDK code repository is stored under GitHub where you can find always the most recent version of SDK with the latest bug fixes and an up to date compatible example app. Clone the repository to your machine to get the SDK and the example apps. Run the following command in the terminal;

git clone https://github.com/digime/digime-android-sdk.git

2. Import project into Android Studio

a. From Android Studio, select "Import Project". This can be found on the window displayed for new projects (as shown below). Or, alternatively, by selecting `File` > `New` > `Import Project...` from Android Studio.

b. Navigate to the cloned project directory, select the repository folder, then click 'ok' to start importing the project to Android Studio

c. Allow the project to complete importing. If shown, please dismiss any prompts to upgrade Gradle for the example app as this may cause compatibility issues.

3. Configure the example app

A demo contract ID and p12 file have already been embedded in the example app for ease of use. The contract selects both Social and Finance data from a digi.me library for a given time period (please contact us if you would like to use a different contract). Add your application ID and p12 password in the build.grade file (digime-android-sdk/examples/consent-access/build.gradle) as shown from the placeholders below:

defaultConfig {
	applicationId "me.digi.examples.ca"
	minSdkVersion buildConfig.minSdk
	targetSdkVersion buildConfig.targetSdk
	versionCode 1
	versionName "1.0"

	/*
	 * Consent Access Configuration parameters:
	 * The following lines set parameters necessary for initialization and usage of the CA API (through SDK):
	 * App ID, Contract ID, Private Key file and Private Key file password if any;
	 * These are helper resource constructors which get injected into AndroidManifest.xml
	 * For further details how these are mapped to meta-data used by the SDK, look at AndroidManifest.xml at the section marked with 
	 */

	resValue "string", "APP_ID", 
"your_real_app_id"
// <- sample: "gDdQfubl66rj07webI92m4afPL9va9Z1" (32 characters hex string given by digi.me support) resValue "string", "P12_KEYSTORE_PASSWORD",
"your_real_key_password"
// <- sample: "20ov;p-1Fi3oL" (the password that goes with your private key). You will need to request the key password from dev support if using pre-set contract ID. resValue "string", "CONTRACT_ID", "gzqYsbQ1V1XROWjmqiFLcH2AF1jvcKcg" // <- demo contract ID for testing purposes resValue "string", "P12_KEYSTORE_FILENAME", "CA_RSA_PRIVATE_KEY.p12" // <- demo private key in assets folder, accompanying the demo contract ID }

4. Build and run

Run the example app then create a digi.me library to use with CA. Ensure that the 'consent-access' sub project is selected, then with an Android device plugged in, click the 'Run' or 'Debug' icon to start

5. Make it your own

Explore the code! Use the sample app as a base or start a new project using the SDK. For more information about the SDK or how to integrate the SDK into an existing or new project, please check out our GitHub Android SDK documentation.

digi.me iOS Quick Start Guide

Get sample projects up and running quickly! The sample project included with the SDK is pre-configured and ready to be compiled and run with little configuration required. Please contact us first to obtain credentials for your application.

Min Requirements

• iOS 11+
• XCode 9 or higher
• Swift 4 or higher
• iPhone 5, iPad (4th generation), or iPad mini (2nd generation)
• Registered Apple developer account

Get started with the example app

1. Clone the example app with the SDK

Download digi.me SDK with a few example apps to try. The digi.me SDK code repository is stored under GitHub where you can find always the most recent version of SDK with the latest bug fixes and an up to date compatible example app. Clone the repository to your machine to get the SDK and the example apps. Run the following command in the terminal;

git clone https://github.com/digime/digime-sdk-ios.git

2. Configure the example app

A demo contract ID and p12 file have already been embedded in the example app for ease of use. The contract selects both Social and Finance data from a digi.me library for a given time period (please contact us if you would like to use a different contract). Set your application ID and p12 password in /Example/ViewController.m as shown from the placeholders below:

// - GET STARTED -

// - INSERT your App ID here -
self.dmeClient.appId = @
"YOUR_APP_ID"
; // - REPLACE 'YOUR_P12_PASSWORD' with password provided by Digi.me Ltd self.dmeClient.privateKeyHex = [DMECryptoUtilities privateKeyHexFromP12File:@"CA_RSA_PRIVATE_KEY" password:@
"YOUR_P12_PASSWORD"
];

Add the application ID in Info.plist and replace the digime-ca-YOUR_APP_ID value found under CFBundleURLTypes->Consent Access key.

<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleTypeRole</key>
		<string>Editor</string>
		<key>CFBundleURLName</key>
		<string>Consent Access</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>digime-ca-
YOUR_APP_ID
</string> </array> </dict> </array>

3. Build and run

Run the example app then create a digi.me library to use with CA.

4. Make it your own

Explore the code! Use the sample app as a base or start a new project using the SDK. For more information about the SDK or how to integrate the SDK into an existing or new project, please check out our GitHub iOS SDK documentation.