Android Swift Objective-C

Installation & Setup


Android Install

Add the following to build.gradle

dependencies {
    implementation "co.payload:payload-android:1.1.7"
}


Manual Install

To include Payload's Android SDK in your project, follow these steps:

  1. Download

Download the latest version from GitHub.

  1. Include in Project

Include the folder in your Android Studio project as a module.


iOS Install

CocoaPod Install


Setup

import co.payload.pl;
import co.payload.android.Payload;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        pl.api_key = "test_client_key_3bezxdVdCLpYP9yJ5odpg";
    }
}
import PayloadAPI

class ViewController: UIViewController {
    override func viewDidLoad() {
        Payload.api_key = "test_client_key_3bezxdVdCLpYP9yJ5odpg"
    }
}
// ViewController.h
#import <Payload/Payload-Swift.h>
// ViewController.m
@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    Payload.api_key = @"test_client_key_3bezxdVdCLpYP9yJ5odpg"
}

Once the SDK is installed, you can import the library and set the client_key to start to interacting with your Payload account. Because these are client-side libraries, they require the client_key, not the secret_key.

Your client key can be found from your dashboard under Settings > API Keys where you'll find both a testing and a production key.