User acquisition

Catappult SDK Rewards (user acquisition)

The Catappult SDK gives you the possibility to integrate on your application, transactions with AppCoins
(APPC) tokens, by rewarding users with APPC tokens when your application is being used.

Abstract

This tutorial will guide you through the process of adding the Catappult SDK as a dependency on your project.

The integration should be simple enough to be done in under 10 minutes. If this is not the case for
you, let us know. The SDK is able to work in the mainnet. You can still use the Ropsten test
network, meaning that APPC of all transactions do not have real monetary value, they are used solely
for testing purposes.

Prerequisites

  • In order for the SDK to work, you must have an AppCoins compliant wallet installed.
  • Minimum gradle plugin version is 3.0.1.
  • Minimum build tools version is 26.0.1.
  • The Android minimum API Level to use SDK is 21 (Android 5.0).
  • Basic understanding of RxJava not required but is recommended.

Build Script

In your project's buildscript, make sure you have the following:

buildscript {
  repositories {
    jcenter()
    google()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
  }
}

allprojects {
  repositories {
    jcenter()
    google()
    maven { url "https://dl.bintray.com/blockchainds/bds" }
  }
}

And in your app's buildscript, add the following dependency:

dependencies {
    api 'com.blockchainds:appcoins-ads:0.4.6.20b'
}

As an example, every time there is an update of the SDKs where no further integration needs to be done, the only thing that should be changed is the version. For example, when the next version is released, the dependencies that should be included in the app's buildscript are:

dependencies {
    api 'com.blockchainds:appcoins:0.4.7.21b'
}

Getting Started

To integrate the User Acquisition SDK, you only need to create an instance of the AdsSdk interface.
In the sample code, we create an instance of the User Acquisition SDK interface in the Application class . Afterwards you only need to initialise the proof-of-attention (PoA) process.

  private static AppCoinsAds adsSdk;

  @Override public void onCreate() {
    super.onCreate();

    adsSdk = new AppCoinsAdsBuilder()
        .createAdvertisementSdk(this);
    try {
      adsSdk.init(this);
    } catch (PackageManager.NameNotFoundException e) {
      e.printStackTrace();
    }
  }

Please note that the calling of the init() is required to be done as soon as possible. For that reason, we recommend doing it on the onCreate() of the Application class so the SDK is aware of the application's Activities life cycle.

After the SDK configuration and initialisation, and as soon as any Activity or your application is started, the SDK will be able to detect when your application is in the foreground and will handle the proof-of-attention (PoA) process.

Size

As of version 0.4.7.21b, SDK weight is approximately as follows:

  • SDK aar only - 35.51KB.

App size increment after adding sdk (assuming no dependencies in common):

  • Without Proguard: 4.9MB.
  • With Proguard: 2.6MB.