NAV

Setting Up SDK(Last Updated : 01/11/2017)

Setup

Download the SDK by either adding our package to your dependency management system (eg. add our artifact to your Maven project), or downloading the files manually.

Currently the SDK only supports OkHttp3 as the HTTP client. Other types of HTTP clients will be supported in the future.

Add Repository

Maven

<repositories> ... <repository> <id>trumpia-repo</id> <url>https://dl.bintray.com/trumpia-developers/maven</url> </repository> </repositories>

Gradle

repositories { ... maven { url 'https://dl.bintray.com/trumpia-developers/maven' } }


Installation

Maven

<dependency> <groupId>com.trumpia.sdk</groupId> <artifactId>client-okhttp3</artifactId> <version>0.2-beta</version> </dependency>

Gradle

dependencies { compile 'com.trumpia.sdk:client-okhttp3:0.2-beta' }

Push Notification Receiver

It is required to have a web server that can receive POST requests. This web server must be accessible publicly or from a static IP.


Once the web server is set up:

  1. Log in to your account.
  2. Hover over the Account tab.
  3. Click on API Settings.
  4. In the Push Result Data section, add your Push Notification URL here.

Please refer to the following images for references and click here for more information.

We also provide tools in our SDK to make it easier for you to set up your web server to handle Push Notifications.

The following is an example on setting up your dependency management configuration to utilize our receivers.


Installation

Maven

<dependency> <groupId>com.trumpia.sdk</groupId> <artifactId>receiver</artifactId> <version>0.2-beta</version> </dependency>

Gradle

dependencies { compile "com.trumpia.sdk:receiver:0.2-beta" }

Your Own Storage

When an API request is sent from one application and the Push Notification is received at a different application, an external storage system could be required to process them.

This storage can be a database, a file, or directory. You can store Request IDs or other required information of request states temporarily and use these to update the status or continue to process them once you receive the results.

As of now, these features are not implemented so you must implement on your own. However, the future SDK versions may support them.