Hello!
According to https://developer.android.com/reference/com/android/billingclient/api/BillingClient.html
When you are done with this object, don't forget to call endConnection() to ensure proper cleanup. This object holds a binding to the in-app billing service and the manager to handle broadcast events, which will leak unless you dispose it correctly. If you created the object inside the onCreate(Bundle) method, then the recommended place to dispose is the the onDestroy() method.
But i can't find this in the code. Shouldn't it be somewhere actually?
As far as i know similar package for android has this: https://github.com/idehub/react-native-billing#close
Thanks.
@vshab Nice catch! I will implement this tommorow! Will be updated in 0.3.10.
@vshab I've just implemented endConnection method on android and tested. I think unlike what react-native-billing suggested, I think you can just call this method when a component is unmounted from your billing page instead calling it in every transaction. I've written how to use this in the README too. Please install 0.3.10 and try it.
@dooboolab thanks for so fast fix.
Currently i'm working on iOS part of my app and will get to Android in a few days. I'll write here how it is as soon as I test it.
@dooboolab
Typo in readme. "componentWillUnmount" instead of "componentWillUnMount"
@vshab glad that you like it. Also @Symyon thank you for the report. I will change readme in next update.
FYI I've finished my android app part and this works well! I do call prepare and endConnection for every function call locking the the entire market screen while performing operation.
Thanks once again.
Most helpful comment
@vshab I've just implemented
endConnectionmethod onandroidand tested. I think unlike whatreact-native-billingsuggested, I think you can just call this method when a component is unmounted from your billing page instead calling it in every transaction. I've written how to use this in theREADMEtoo. Please install0.3.10and try it.