Skip to content

Commit

Permalink
Update DataCoroutines.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
gdeluna-branch committed Jul 13, 2023
1 parent dabd187 commit 8de3690
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package io.branch.referral.coroutines

import android.content.Context
import android.util.Log
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import io.branch.referral.PrefHelper
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

suspend fun getAdvertisingInfoObject(context: Context): AdvertisingIdClient.Info? {
return withContext(Dispatchers.Default) {
try {
val info = AdvertisingIdClient.getAdvertisingIdInfo(context)
Log.d("BranchSDK", "getAdvertisingIdInfo received: $info")
info
AdvertisingIdClient.getAdvertisingIdInfo(context)
} catch (exception: Exception) {
Log.d("BranchSDK", "getAdvertisingIdInfo exception: $exception")
PrefHelper.Debug("getAdvertisingIdInfo exception: $exception")
null
}
}
Expand Down

0 comments on commit 8de3690

Please sign in to comment.