All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.revenuemonster.sdk.module.NotificationModule.kt Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package io.revenuemonster.sdk.module

import io.ktor.http.*
import io.revenuemonster.sdk.RevenueMonsterSDK
import io.revenuemonster.sdk.model.Response

class NotificationModule(private val sdk : RevenueMonsterSDK) {

    suspend fun sendMerchant(title : String, body: String) : Response{
        return sdk.call(
            url = "/v3/push-notification/merchant",
            method = HttpMethod.Post,
            body = mapOf(
                "title" to title,
                "body" to body
            )
        )
    }

    suspend fun sendStore(storeId: String, title : String, body: String) : Response{
        return sdk.call(
            url = "/v3/push-notification/store/$storeId",
            method = HttpMethod.Post,
            body = mapOf(
                "title" to title,
                "body" to body
            )
        )
    }

    suspend fun sendUser(userId : String, title : String, body: String) : Response{
        return sdk.call(
            url = "/v3/push-notification/user/$userId",
            method = HttpMethod.Post,
            body = mapOf(
                "title" to title,
                "body" to body
            )
        )
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy