package com.gh.gamecenter.acloud.push

import com.alibaba.sdk.android.push.CommonCallback
import io.reactivex.SingleEmitter

class ACloudPushCommonCallback(private val emitter: SingleEmitter<String>) : CommonCallback {
    override fun onSuccess(response: String) {
        if (!emitter.isDisposed) emitter.onSuccess(response)
    }

    override fun onFailed(errorCode: String, errorMessage: String) {
        if (!emitter.isDisposed) emitter.onError(ACloudPushException(errorCode, errorMessage))
    }
}