Skip to content

Latest commit

 

History

History
44 lines (39 loc) · 1015 Bytes

1_Installation.md

File metadata and controls

44 lines (39 loc) · 1015 Bytes

Push Kotlin Sdk

This package gives access to Push Protocol (Push Nodes) APIs. Visit Developer Docs or Push.org to learn more.


Setting Up

In buid.gradle add:

repositories {
    mavenCentral()
    // new
    maven {
        url = uri("https://jitpack.io")
    }
}

dependencies {
    implementation("com.github.ethereum-push-notification-service:push-kotlin-sdk:SDK_VERSION")
}

Using the sdk

Import the package as:

import push.kotlin.sdk
import push.kotlin.sdk.PushUser
import push.kotlin.sdk.ENV

fun main() {
    val PGP_PRIVATE_KEY = "PGP PRIVATE KEY ARMOR"
    val USER_ADDRESS = "USET_ETH_ADDRESS"
    val feeds = PushChat.getChats(
        PushChat.GetChatsOptions(
            USER_ADDRESS
            PGP_PRIVATE_KEY,
            true, 
            1,
            10,
            ENV.staging
        )
    ) ?: throw IllegalStateException()

    feeds.forEach { feed -> println(feed.msg.messageContent)  }
}