Hi I am trying to get advertising id from AdvertisingIdClient
, this is what I have but it gives me a warning Inappropriate blocking method call
How can I resolve this please
private suspend fun getAdvertisingId(): String? {
return withContext(Dispatchers.Default) {
try {
AdvertisingIdClient.getAdvertisingIdInfo(ohmeApp.applicationContext).id
} catch (exception: Exception) {
"" // there still can be an exception for other reasons but not for thread issue
}
}
}
Could you please suggest what I can do to resolve this please.