react-native-purchases 9.0.0 → 9.2.0

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.
@@ -25,6 +25,6 @@ Pod::Spec.new do |spec|
25
25
  ]
26
26
 
27
27
  spec.dependency "React-Core"
28
- spec.dependency "PurchasesHybridCommon", '15.0.0'
28
+ spec.dependency "PurchasesHybridCommon", '16.2.0'
29
29
  spec.swift_version = '5.7'
30
30
  end
@@ -6,7 +6,7 @@ buildscript {
6
6
  }
7
7
 
8
8
  dependencies {
9
- classpath 'com.android.tools.build:gradle:8.11.1'
9
+ classpath 'com.android.tools.build:gradle:8.12.0'
10
10
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11
11
  }
12
12
  }
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '9.0.0'
32
+ versionName '9.2.0'
33
33
  }
34
34
 
35
35
  buildTypes {
@@ -121,6 +121,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
121
121
  dependencies {
122
122
  //noinspection GradleDynamicVersion
123
123
  api 'com.facebook.react:react-native:+'
124
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:15.0.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:16.2.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -47,7 +47,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
47
47
  private static final String CUSTOMER_INFO_UPDATED = "Purchases-CustomerInfoUpdated";
48
48
  private static final String LOG_HANDLER_EVENT = "Purchases-LogHandlerEvent";
49
49
  public static final String PLATFORM_NAME = "react-native";
50
- public static final String PLUGIN_VERSION = "9.0.0";
50
+ public static final String PLUGIN_VERSION = "9.2.0";
51
51
 
52
52
  private final ReactApplicationContext reactContext;
53
53
 
@@ -338,6 +338,29 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
338
338
  promise.resolve(Purchases.isConfigured());
339
339
  }
340
340
 
341
+ //================================================================================
342
+ // Virtual Currencies
343
+ //================================================================================
344
+ @ReactMethod
345
+ public void getVirtualCurrencies(final Promise promise) {
346
+ CommonKt.getVirtualCurrencies(getOnResult(promise));
347
+ }
348
+
349
+ @ReactMethod
350
+ public void invalidateVirtualCurrenciesCache() {
351
+ CommonKt.invalidateVirtualCurrenciesCache();
352
+ }
353
+
354
+ @ReactMethod
355
+ public void getCachedVirtualCurrencies(final Promise promise) {
356
+ Map<String, ?> cachedVirtualCurrencies = CommonKt.getCachedVirtualCurrencies();
357
+ if (cachedVirtualCurrencies == null) {
358
+ promise.resolve(null);
359
+ } else {
360
+ promise.resolve(convertMapToWriteableMap(cachedVirtualCurrencies));
361
+ }
362
+ }
363
+
341
364
  //================================================================================
342
365
  // Subscriber Attributes
343
366
  //================================================================================
@@ -1,53 +1,55 @@
1
- import { CustomerInfo, MakePurchaseResult, PurchasesStoreTransaction, WebPurchaseRedemptionResultType, PurchasesStoreProduct, PurchasesOffering, PurchasesOfferings } from '@revenuecat/purchases-typescript-internal';
1
+ import 'react-native-get-random-values';
2
+ import { MakePurchaseResult } from '@revenuecat/purchases-typescript-internal';
2
3
  /**
3
- * Preview implementation of the native module for Preview API mode, i.e. for environments where native modules are not available
4
- * (like Expo Go).
4
+ * Browser implementation of the native module. This will be used in the browser and Expo Go.
5
5
  */
6
- export declare const previewNativeModuleRNPurchases: {
7
- setupPurchases: (apiKey: string, _appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean) => Promise<null>;
6
+ export declare const browserNativeModuleRNPurchases: {
7
+ setupPurchases: (apiKey: string, appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean) => Promise<void>;
8
8
  setAllowSharingStoreAccount: (_allowSharing: boolean) => Promise<void>;
9
9
  setSimulatesAskToBuyInSandbox: (_simulatesAskToBuyInSandbox: boolean) => Promise<void>;
10
- getOfferings: () => Promise<PurchasesOfferings>;
11
- getCurrentOfferingForPlacement: (_placementIdentifier: string) => Promise<PurchasesOffering>;
12
- syncAttributesAndOfferingsIfNeeded: () => Promise<PurchasesOfferings>;
13
- getProductInfo: (_productIdentifiers: string[], _type: string) => Promise<PurchasesStoreProduct[]>;
14
- restorePurchases: () => Promise<CustomerInfo>;
10
+ getOfferings: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
11
+ getCurrentOfferingForPlacement: (placementIdentifier: string) => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOffering | null>;
12
+ syncAttributesAndOfferingsIfNeeded: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
13
+ getProductInfo: (_productIdentifiers: string[], _type: string) => Promise<void>;
14
+ restorePurchases: () => Promise<import("@revenuecat/purchases-typescript-internal").CustomerInfo>;
15
15
  getAppUserID: () => Promise<string>;
16
- getStorefront: () => Promise<string>;
16
+ getStorefront: () => Promise<void>;
17
17
  setDebugLogsEnabled: (_enabled: boolean) => Promise<void>;
18
- setLogLevel: (_level: string) => Promise<void>;
19
- setLogHandler: () => Promise<null>;
20
- getCustomerInfo: () => Promise<CustomerInfo>;
21
- logIn: (_appUserID: string) => Promise<{
22
- customerInfo: CustomerInfo;
18
+ setLogLevel: (level: string) => Promise<void>;
19
+ setLogHandler: (_handler: (message: string) => void) => Promise<void>;
20
+ getCustomerInfo: () => Promise<import("@revenuecat/purchases-typescript-internal").CustomerInfo>;
21
+ logIn: (appUserID: string) => Promise<{
22
+ customerInfo: import("@revenuecat/purchases-typescript-internal").CustomerInfo;
23
23
  created: boolean;
24
24
  }>;
25
- logOut: () => Promise<CustomerInfo>;
25
+ logOut: () => Promise<import("@revenuecat/purchases-typescript-internal").CustomerInfo>;
26
26
  syncPurchases: () => Promise<void>;
27
27
  syncAmazonPurchase: (_productID: string, _receiptID: string, _amazonUserID: string, _isoCurrencyCode: string | null, _price: number | null) => Promise<void>;
28
28
  syncObserverModeAmazonPurchase: (_productID: string, _receiptID: string, _amazonUserID: string, _isoCurrencyCode: string | null, _price: number | null) => Promise<void>;
29
- recordPurchaseForProductID: (_productID: string) => Promise<PurchasesStoreTransaction>;
29
+ recordPurchaseForProductID: (_productID: string) => Promise<void>;
30
30
  enableAdServicesAttributionTokenCollection: () => Promise<void>;
31
- purchaseProduct: (_productIdentifier: string, _googleProductChangeInfo: any, _type: string, _discountTimestamp: string | null, _googleInfo: any, _presentedOfferingContext: any) => Promise<MakePurchaseResult>;
32
- purchasePackage: (_packageIdentifier: string, _presentedOfferingContext: any, _googleProductChangeInfo: any, _discountTimestamp: string | null, _googleInfo: any) => Promise<MakePurchaseResult>;
33
- purchaseSubscriptionOption: (_productIdentifier: string, _optionIdentifier: string, _upgradeInfo: any, _discountTimestamp: string | null, _googleInfo: any, _presentedOfferingContext: any) => Promise<MakePurchaseResult>;
31
+ purchaseProduct: (_productIdentifier: string, _googleProductChangeInfo: any, _type: string, _discountTimestamp: string | null, _googleInfo: any, _presentedOfferingContext: any) => Promise<void>;
32
+ purchasePackage: (packageIdentifier: string, presentedOfferingContext: any, _googleProductChangeInfo: any, _discountTimestamp: string | null, _googleInfo: any) => Promise<MakePurchaseResult>;
33
+ purchaseSubscriptionOption: (_productIdentifier: string, _optionIdentifier: string, _upgradeInfo: any, _discountTimestamp: string | null, _googleInfo: any, _presentedOfferingContext: any) => Promise<void>;
34
34
  isAnonymous: () => Promise<boolean>;
35
35
  makeDeferredPurchase: (_callbackID: number) => Promise<void>;
36
36
  checkTrialOrIntroductoryPriceEligibility: (productIDs: string[]) => Promise<{
37
37
  [productId: string]: any;
38
38
  }>;
39
- getPromotionalOffer: (_productIdentifier: string, _discount: any) => Promise<undefined>;
40
- eligibleWinBackOffersForProductIdentifier: (_productID: string) => Promise<never[]>;
41
- purchaseProductWithWinBackOffer: (_productID: string, _winBackOfferID: string) => Promise<MakePurchaseResult>;
42
- purchasePackageWithWinBackOffer: (_packageID: string, _winBackOfferID: string) => Promise<MakePurchaseResult>;
39
+ getPromotionalOffer: (_productIdentifier: string, _discount: any) => Promise<void>;
40
+ eligibleWinBackOffersForProductIdentifier: (_productID: string) => Promise<void>;
41
+ purchaseProductWithWinBackOffer: (_productID: string, _winBackOfferID: string) => Promise<void>;
42
+ purchasePackageWithWinBackOffer: (_packageID: string, _winBackOfferID: string) => Promise<void>;
43
43
  invalidateCustomerInfoCache: () => Promise<void>;
44
44
  presentCodeRedemptionSheet: () => Promise<void>;
45
- setAttributes: (_attributes: any) => Promise<void>;
46
- setEmail: (_email: string) => Promise<void>;
47
- setPhoneNumber: (_phoneNumber: string) => Promise<void>;
48
- setDisplayName: (_displayName: string) => Promise<void>;
45
+ setAttributes: (attributes: {
46
+ [key: string]: string | null;
47
+ }) => Promise<void>;
48
+ setEmail: (email: string) => Promise<void>;
49
+ setPhoneNumber: (phoneNumber: string) => Promise<void>;
50
+ setDisplayName: (displayName: string) => Promise<void>;
49
51
  setPushToken: (_pushToken: string) => Promise<void>;
50
- setProxyURLString: (_proxyURLString: string) => Promise<void>;
52
+ setProxyURLString: (proxyURLString: string) => Promise<void>;
51
53
  collectDeviceIdentifiers: () => Promise<void>;
52
54
  setAdjustID: (_adjustID: string) => Promise<void>;
53
55
  setAppsflyerID: (_appsflyerID: string) => Promise<void>;
@@ -68,15 +70,15 @@ export declare const previewNativeModuleRNPurchases: {
68
70
  setKeyword: (_keyword: string) => Promise<void>;
69
71
  setCreative: (_creative: string) => Promise<void>;
70
72
  canMakePayments: (_features: any[]) => Promise<boolean>;
71
- beginRefundRequestForActiveEntitlement: () => Promise<number>;
72
- beginRefundRequestForEntitlementId: (_entitlementIdentifier: string) => Promise<number>;
73
- beginRefundRequestForProductId: (_productIdentifier: string) => Promise<number>;
73
+ beginRefundRequestForActiveEntitlement: () => Promise<void>;
74
+ beginRefundRequestForEntitlementId: (_entitlementIdentifier: string) => Promise<void>;
75
+ beginRefundRequestForProductId: (_productIdentifier: string) => Promise<void>;
74
76
  showManageSubscriptions: () => Promise<void>;
75
77
  showInAppMessages: (_messageTypes: any[]) => Promise<void>;
76
- isWebPurchaseRedemptionURL: (_urlString: string) => Promise<boolean>;
78
+ isWebPurchaseRedemptionURL: (_urlString: string) => Promise<void>;
77
79
  isConfigured: () => Promise<boolean>;
78
- redeemWebPurchase: (_urlString: string) => Promise<{
79
- result: WebPurchaseRedemptionResultType;
80
- customerInfo: CustomerInfo;
81
- }>;
80
+ redeemWebPurchase: (_urlString: string) => Promise<void>;
81
+ getVirtualCurrencies: () => Promise<void>;
82
+ invalidateVirtualCurrenciesCache: () => Promise<void>;
83
+ getCachedVirtualCurrencies: () => Promise<void>;
82
84
  };