Skip to content

Commit

Permalink
Give more detailed error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson committed Mar 28, 2024
1 parent bd85288 commit d878626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion snowplow-demo-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-appset:16.0.2'
implementation 'com.google.android.gms:play-services-ads:22.6.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation "com.android.installreferrer:installreferrer:2.2"
implementation "com.android.installreferrer:installreferrer:1.0"

implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.snowplowanalytics.core.tracker

import android.content.Context
import android.os.RemoteException
import com.android.installreferrer.api.InstallReferrerClient
import com.android.installreferrer.api.InstallReferrerStateListener
import com.android.installreferrer.api.InstallReferrerClient.InstallReferrerResponse
Expand Down Expand Up @@ -71,9 +72,12 @@ class InstallReferrerDetails(
googlePlayInstantParam = response.googlePlayInstantParam
)
callback(referrer)
} catch (_: Throwable) {
} catch (_: RemoteException) {
Logger.d(TAG, "Install referrer API remote exception.")
callback(null)
} catch (_: NoSuchMethodError) {
Logger.d(TAG, "Upgrade InstallReferrer package to v1.1 or higher to add the install referrer details entity.")
callback(null)
}
}
InstallReferrerResponse.FEATURE_NOT_SUPPORTED -> {
Expand Down

0 comments on commit d878626

Please sign in to comment.