uerceg / play-install-referrer-react-native

Play Install Referrer Library ported to React Native
MIT License
25 stars 2 forks source link

Connection should be closed after retrieving referrer information #38

Open bilalq opened 9 months ago

bilalq commented 9 months ago

Is your feature request related to a problem? Please describe. From Google's docs on the Play Install Referrer library:

Closing service connection After getting referrer information, call the [endConnection()](https://developer.android.com/reference/com/android/installreferrer/api/InstallReferrerClient#endConnection()) method on your InstallReferrerClient instance to close the connection. Closing the connection will help you avoid leaks and performance problems.

For further information, refer to the Play Install Referrer Library Reference.

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

Describe the solution you'd like I'm not very familiar with the specifics of this API, but it seems like the endConnection call can be made in the success case for onInstallReferrerSetupFinished.

Describe alternatives you've considered It's not terrible to leave as-is if you avoid running the native module outside of the first run based on local storage lookups, but since the docs specifically instruct doing this, it probably would be best to just close the connection.

Additional context N/A