package com.gh.gamecenter.acloud.push.provider

import android.content.Context
import com.gh.gamecenter.acloud.push.ACloudPushHelper
import com.gh.gamecenter.core.provider.IPushProvider
import io.reactivex.Single

/**
 * 阿里云推送服务提供者类
 */
@com.therouter.inject.ServiceProvider
class ACloudPushProviderImpl : IPushProvider {

    override fun initialize(applicationContext: Context) {
        ACloudPushHelper.init(applicationContext)
    }

    override fun register(applicationContext: Context): Single<String> {
        return ACloudPushHelper.register(applicationContext)
    }

    override fun bindAccount(account: String): Single<String> {
        return ACloudPushHelper.bindAccount(account)
    }

    override fun bindAlias(alias: String): Single<String> {
        return ACloudPushHelper.bindAlias(alias)
    }

    override fun unbindAlias(alias: String): Single<String> {
        return ACloudPushHelper.unbindAlias(alias)
    }

    override fun bindChannel(channel: String): Single<String> {
        return ACloudPushHelper.bindTag(channel)
    }

    override fun getRegistrationId(context: Context): String {
        return ""
    }

    override fun cleanBadgeNumber(applicationContext: Context) {
        // do nothing
    }

    override fun setOnPushOpenedCallback(callback: (String, String, String, String) -> Unit) {
        // do nothing
    }
}