Skip to content

Commit

Permalink
Fix referrer bug
Browse files Browse the repository at this point in the history
Summary:
Fix issue #1039 , we'll need to end the connection to avoid leaks and performance problems.

https://developer.android.com/google/play/installreferrer/library#closing-connection

Reviewed By: wx0165927473

Differential Revision: D44238528

fbshipit-source-id: 868b108305c2aa964c91c2456309e45fd06e0070
  • Loading branch information
KylinChang authored and facebook-github-bot committed Mar 21, 2023
1 parent 63062e9 commit 29af39e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ object InstallReferrerUtil {
updateReferrer() // No point retrying if feature not supported
InstallReferrerResponse.SERVICE_UNAVAILABLE -> {}
}
try {
referrerClient.endConnection()
} catch (e: Exception) {
// Silent endConnection errors for unit test and else
}
}

override fun onInstallReferrerServiceDisconnected() = Unit
Expand Down

0 comments on commit 29af39e

Please sign in to comment.