I am trying to connect to the TenderConnector, but keep getting the following expection:
com.clover.sdk.v1.BindingException: Could not bind to Android service
This is my implementation:
suspend fun checkTenderStatus(tenderConnector: TenderConnector, tenderLabelKey: String) = suspendCoroutine<TenderStatus> { cont -> var result: TenderStatus = TenderStatus.Fail(Exception("Check Status Failed.")) tenderConnector.connect() tenderConnector.getTenders(object : TenderConnector.TenderCallback<List<Tender>>() { override fun onServiceConnectionFailure() { super.onServiceConnectionFailure() cont.resume(result) } override fun onServiceSuccess(tenders: List<Tender>?, status: ResultStatus?) { super.onServiceSuccess(tenders, status) val tender = tenders?.find { it.labelKey == tenderLabelKey } if (tender != null) { result = if (tender.enabled) { TenderStatus.Enabled(tender.id) } else { TenderStatus.NotEnabled } } else { result = TenderStatus.NotRun } cont.resume(result) } override fun onServiceFailure(status: ResultStatus?) { super.onServiceFailure(status) cont.resume(result) } }) }