Back to top

Surf SDK Documentation

This is an installation guide for getting Surf’s Android SDK working within your Android app.


This documentation will reference an api_key, needed to initialize the Surf SDK. You can find your api_key on your profile edit page on Furthermore, for the Gradle Dependency, you will need a username and password. This currently can only be done manually, so please contact us to generate one for you via email.


Please add the following dependency to your app gradle file:

repositories {
   maven {
       credentials {
           username 'your_given_username'
           password 'your_given_password'
       url ""

dependencies {
    compile 'com.surfsup:sdk:1.+'



Start off by calling the next function on your application start, or when you find it appropriate to instantiate the Surf SDK:

Surf.init(Context, "your_api_key");

Enable Permissions

Our SDK requires 3 permissions to be enabled, and depends on which android version the user is running.

Note that the User is not forced to give these permissions. However, each adds unique and useful intelligence to our User-Companionship System, allowing us to identify more contextually-aware Moments for the User.


If you haven’t implemented this into your app yet, you can ask for permission by adding the following code:


Draw Over Other Apps

The following code will send the user to the settings screen to enable this permission:


App Usage

The following code will send the user to the settings screen to enable this permission:



For internal testing to see whether notifications work, you can fire them manually by using the following code:


Note: on Android 6.0 and up, if you don’t have draw over apps permission given, you won’t receive a notification.

Generated by aglio on 03 Apr 2017