private fun getTokenForRecommendationApi() { viewModelScope.launch(Dispatchers.IO) { val tokenHeaders = HashMap<String, String>() tokenHeaders["Authorization"] = "Basic " + SecurityService.instance.getString(SecurityService.Keys.saphcpToken) when(val result = getCountryDataUseCase.addressCleanser( fullUrl = NetworkingService.getAddressCorrectionTokenURL(), headers = tokenHeaders )) { is RemoteResponse.Success -> { getRecommendationDetails(result.value) } is RemoteResponse.Failure -> { } } } }
Function to get the Recommendation token details for the address entered by the user