@capgo/native-purchases 0.0.4 → 0.0.5
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.
|
@@ -117,30 +117,30 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
117
117
|
public void restorePurchases(PluginCall call) {
|
|
118
118
|
Log.d("NativePurchases", "restorePurchases");
|
|
119
119
|
|
|
120
|
-
if (billingClient.isReady()) {
|
|
121
|
-
|
|
120
|
+
// if (billingClient.isReady()) {
|
|
121
|
+
// Purchase.PurchasesResult purchasesResult = billingClient.queryPurchases(BillingClient.SkuType.INAPP);
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
// if (purchasesResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
|
|
124
|
+
// List<Purchase> purchasesList = purchasesResult.getPurchasesList();
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
// JSObject ret = new JSObject();
|
|
127
|
+
// JSONArray purchases = new JSONArray();
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
// for (Purchase purchase : purchasesList) {
|
|
130
|
+
// JSObject purchaseObject = new JSObject();
|
|
131
|
+
// purchaseObject.put("productId", purchase.getSku());
|
|
132
|
+
// purchaseObject.put("transactionId", purchase.getPurchaseToken());
|
|
133
|
+
// purchaseObject.put("purchaseTime", purchase.getPurchaseTime());
|
|
134
|
+
// purchases.put(purchaseObject);
|
|
135
|
+
// }
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
137
|
+
// ret.put("purchases", purchases);
|
|
138
|
+
// call.resolve(ret);
|
|
139
|
+
// } else {
|
|
140
|
+
// // Handle any other error codes.
|
|
141
|
+
// call.reject("Unknown error");
|
|
142
|
+
// }
|
|
143
|
+
// }
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
|