react-native-iap 8.1.1 → 8.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -49,7 +49,7 @@ class RNIapModule(reactContext: ReactApplicationContext) :
49
49
 
50
50
  private fun ensureConnection(promise: Promise, callback: EnsureConnectionCallback) {
51
51
  val billingClient = billingClientCache
52
- if (billingClient != null && billingClient.isReady) {
52
+ if (billingClient?.isReady == true) {
53
53
  callback.run(billingClient)
54
54
  return
55
55
  }
@@ -58,7 +58,7 @@ class RNIapModule(reactContext: ReactApplicationContext) :
58
58
 
59
59
  @ReactMethod
60
60
  fun initConnection(promise: Promise) {
61
- if (billingClientCache != null) {
61
+ if (billingClientCache?.isReady == true) {
62
62
  Log.i(
63
63
  TAG,
64
64
  "Already initialized, you should only call initConnection() once when your app starts"
@@ -94,6 +94,7 @@ class RNIapModule(reactContext: ReactApplicationContext) :
94
94
 
95
95
  override fun onBillingServiceDisconnected() {
96
96
  try {
97
+ billingClientCache = null
97
98
  promise.reject("initConnection", "Billing service disconnected")
98
99
  } catch (oce: ObjectAlreadyConsumedException) {
99
100
  Log.e(TAG, oce.message!!)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "8.1.1",
3
+ "version": "8.1.2",
4
4
  "packageManager": "yarn@3.2.0",
5
5
  "description": "React Native In App Purchase Module.",
6
6
  "main": "index.js",