react-native-iap 9.0.0-beta5 → 9.0.0-beta6
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.
|
@@ -321,7 +321,10 @@ class RNIapModule(
|
|
|
321
321
|
for (i in purchases.indices) {
|
|
322
322
|
val purchase = purchases[i]
|
|
323
323
|
val item = WritableNativeMap()
|
|
324
|
-
item.putString("productId", purchase.products[0])
|
|
324
|
+
item.putString("productId", purchase.products[0])// kept for convenience/backward-compatibility. productIds has the complete list
|
|
325
|
+
val products = Arguments.createArray()
|
|
326
|
+
purchase.products.forEach { products.pushString(it) }
|
|
327
|
+
item.putArray("productIds", products)
|
|
325
328
|
item.putString("transactionId", purchase.orderId)
|
|
326
329
|
item.putDouble("transactionDate", purchase.purchaseTime.toDouble())
|
|
327
330
|
item.putString("transactionReceipt", purchase.originalJson)
|
|
@@ -370,6 +373,9 @@ class RNIapModule(
|
|
|
370
373
|
purchaseHistoryRecordList?.forEach { purchase ->
|
|
371
374
|
val item = Arguments.createMap()
|
|
372
375
|
item.putString("productId", purchase.products[0])
|
|
376
|
+
val products = Arguments.createArray()
|
|
377
|
+
purchase.products.forEach { products.pushString(it) }
|
|
378
|
+
item.putArray("productIds", products)
|
|
373
379
|
item.putDouble("transactionDate", purchase.purchaseTime.toDouble())
|
|
374
380
|
item.putString("transactionReceipt", purchase.originalJson)
|
|
375
381
|
item.putString("purchaseToken", purchase.purchaseToken)
|
|
@@ -442,14 +448,14 @@ class RNIapModule(
|
|
|
442
448
|
if (obfuscatedProfileId != null) {
|
|
443
449
|
builder.setObfuscatedProfileId(obfuscatedProfileId)
|
|
444
450
|
}
|
|
445
|
-
if (prorationMode !=
|
|
451
|
+
if (prorationMode != -1) {
|
|
446
452
|
if (prorationMode
|
|
447
453
|
== BillingFlowParams.ProrationMode.IMMEDIATE_AND_CHARGE_PRORATED_PRICE
|
|
448
454
|
) {
|
|
449
455
|
subscriptionUpdateParamsBuilder.setReplaceProrationMode(
|
|
450
456
|
BillingFlowParams.ProrationMode.IMMEDIATE_AND_CHARGE_PRORATED_PRICE
|
|
451
457
|
)
|
|
452
|
-
if (type != BillingClient.
|
|
458
|
+
if (type != BillingClient.ProductType.SUBS) {
|
|
453
459
|
val debugMessage =
|
|
454
460
|
(
|
|
455
461
|
"IMMEDIATE_AND_CHARGE_PRORATED_PRICE for proration mode only works in" +
|
|
@@ -561,6 +567,7 @@ class RNIapModule(
|
|
|
561
567
|
.getBillingResponseData(billingResult.responseCode)
|
|
562
568
|
map.putString("code", errorData[0])
|
|
563
569
|
map.putString("message", errorData[1])
|
|
570
|
+
map.putString("purchaseToken",purchaseToken)
|
|
564
571
|
promise.safeResolve(map)
|
|
565
572
|
}
|
|
566
573
|
}
|
|
@@ -586,6 +593,9 @@ class RNIapModule(
|
|
|
586
593
|
val item = Arguments.createMap()
|
|
587
594
|
val purchase = purchases[i]
|
|
588
595
|
item.putString("productId", purchase.products[0])
|
|
596
|
+
val products = Arguments.createArray()
|
|
597
|
+
purchase.products.forEach { products.pushString(it) }
|
|
598
|
+
item.putArray("productIds", products)
|
|
589
599
|
item.putString("transactionId", purchase.orderId)
|
|
590
600
|
item.putDouble("transactionDate", purchase.purchaseTime.toDouble())
|
|
591
601
|
item.putString("transactionReceipt", purchase.originalJson)
|
package/ios/RNIapIos.m
CHANGED
|
@@ -18,7 +18,6 @@ RCT_EXTERN_METHOD(getAvailableItems:
|
|
|
18
18
|
reject:(RCTPromiseRejectBlock)reject)
|
|
19
19
|
RCT_EXTERN_METHOD(buyProduct:
|
|
20
20
|
(NSString*)sku
|
|
21
|
-
appAccountToken:(NSString*)appAccountToken
|
|
22
21
|
andDangerouslyFinishTransactionAutomatically:(BOOL)andDangerouslyFinishTransactionAutomatically
|
|
23
22
|
applicationUsername:(NSString)applicationUsername
|
|
24
23
|
resolve:(RCTPromiseResolveBlock)resolve
|
package/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare enum InstallSourceAndroid {
|
|
|
37
37
|
export interface ProductCommon {
|
|
38
38
|
type: 'subs' | 'sub' | 'inapp' | 'iap';
|
|
39
39
|
productId: string;
|
|
40
|
+
productIds?: string[];
|
|
40
41
|
title: string;
|
|
41
42
|
description: string;
|
|
42
43
|
price: string;
|
|
@@ -46,6 +47,7 @@ export interface ProductCommon {
|
|
|
46
47
|
}
|
|
47
48
|
export interface ProductPurchase {
|
|
48
49
|
productId: string;
|
|
50
|
+
productIds?: string[];
|
|
49
51
|
transactionId?: string;
|
|
50
52
|
transactionDate: number;
|
|
51
53
|
transactionReceipt: string;
|
|
@@ -142,12 +144,8 @@ export interface RequestPurchase {
|
|
|
142
144
|
obfuscatedAccountIdAndroid: string | undefined;
|
|
143
145
|
obfuscatedProfileIdAndroid: string | undefined;
|
|
144
146
|
}
|
|
145
|
-
export interface RequestSubscription {
|
|
146
|
-
sku: string;
|
|
147
|
-
andDangerouslyFinishTransactionAutomaticallyIOS: boolean;
|
|
147
|
+
export interface RequestSubscription extends RequestPurchase {
|
|
148
148
|
purchaseTokenAndroid: string | undefined;
|
|
149
149
|
prorationModeAndroid: ProrationModesAndroid;
|
|
150
|
-
|
|
151
|
-
obfuscatedProfileIdAndroid: string | undefined;
|
|
152
|
-
selectedOfferIndex?: number | undefined;
|
|
150
|
+
selectedOfferIndex: number | undefined;
|
|
153
151
|
}
|
package/.yarn/install-state.gz
DELETED
|
Binary file
|