/K-akaoLink

KakaoLink Module implemented for Java/Kotlin

Primary LanguageKotlinGNU General Public License v3.0GPL-3.0

K-akaoLink

License: GPL v3

KakaoLink Module implemented for Java/Kotlin

Installation

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
    implementation 'com.github.mooner1022:K-akaoLink:(VERSION)'
}

Usage

Basic usage

val kakaoLink = KakaoLink("javascript_api_key","https://your_domain_here") // init library

Thread { // create new thread for network
    kakaoLink.login("your_email@gmail.com","password") { // on login finished (optional)
        kakaoLink.send("YOUR_ROOM_NAME",
            KakaoParams(
                link_ver = "4.0",
                template_id = 10000,
                template_args = mapOf(
                    "title" to "테스트 제목"
                )
            ),"custom") // send template
    }
}.start() // start the thread

Another usage

val kakaoLink = KakaoLink("javascript_api_key","https://your_domain_here") // init library

Thread {
    kakaoLink.login("your_email@gmail.com","password") // login
}.start()

...

fun sendKaling(room:String,message:String) {
    Thread { // Call when it needs to be sent
        kakaoLink.send(room,
            KakaoParams(
                link_ver = "4.0",
                template_id = 10000,
                template_args = mapOf(
                    "message" to message
                )
            ),"custom") // send template
    }.start()
}