react-native-purchases 10.4.3 → 10.5.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.
- package/RNPurchases.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +17 -3
- package/dist/browser/nativeModule.d.ts +3 -1
- package/dist/browser/nativeModule.js +13 -1
- package/dist/purchases.d.ts +76 -0
- package/dist/purchases.js +52 -3
- package/ios/PurchasesPlugin.swift +11 -0
- package/ios/RNPurchases.m +25 -3
- package/package.json +3 -3
package/RNPurchases.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -29,7 +29,7 @@ android {
|
|
|
29
29
|
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
30
30
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
31
31
|
versionCode 1
|
|
32
|
-
versionName '10.
|
|
32
|
+
versionName '10.5.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:18.
|
|
124
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.26.0'
|
|
125
125
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
126
126
|
}
|
|
@@ -51,7 +51,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
51
51
|
private static final String TRACKED_EVENT = "Purchases-TrackedEvent";
|
|
52
52
|
private static final String DEBUG_EVENT = "Purchases-DebugEvent";
|
|
53
53
|
public static final String PLATFORM_NAME = "react-native";
|
|
54
|
-
public static final String PLUGIN_VERSION = "10.
|
|
54
|
+
public static final String PLUGIN_VERSION = "10.5.0";
|
|
55
55
|
|
|
56
56
|
private final ReactApplicationContext reactContext;
|
|
57
57
|
|
|
@@ -96,7 +96,8 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
96
96
|
boolean pendingTransactionsForPrepaidPlansEnabled,
|
|
97
97
|
boolean diagnosticsEnabled,
|
|
98
98
|
boolean automaticDeviceIdentifierCollectionEnabled,
|
|
99
|
-
@Nullable String preferredUILocaleOverride
|
|
99
|
+
@Nullable String preferredUILocaleOverride,
|
|
100
|
+
boolean useWorkflows) {
|
|
100
101
|
PlatformInfo platformInfo = new PlatformInfo(PLATFORM_NAME, PLUGIN_VERSION);
|
|
101
102
|
Store store = Store.PLAY_STORE;
|
|
102
103
|
if ("GALAXY".equals(storeString)) {
|
|
@@ -104,6 +105,9 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
104
105
|
} else if (useAmazon) {
|
|
105
106
|
store = Store.AMAZON;
|
|
106
107
|
}
|
|
108
|
+
DangerousSettings dangerousSettings = useWorkflows
|
|
109
|
+
? DangerousSettings.forWorkflows(true)
|
|
110
|
+
: new DangerousSettings();
|
|
107
111
|
CommonKt.configure(
|
|
108
112
|
reactContext,
|
|
109
113
|
apiKey,
|
|
@@ -111,7 +115,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
111
115
|
purchasesAreCompletedBy,
|
|
112
116
|
platformInfo,
|
|
113
117
|
store,
|
|
114
|
-
|
|
118
|
+
dangerousSettings,
|
|
115
119
|
shouldShowInAppMessagesAutomatically,
|
|
116
120
|
entitlementVerificationMode,
|
|
117
121
|
pendingTransactionsForPrepaidPlansEnabled,
|
|
@@ -655,6 +659,16 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
655
659
|
CommonKt.trackAdFailedToLoad(data.toHashMap());
|
|
656
660
|
}
|
|
657
661
|
|
|
662
|
+
@ReactMethod
|
|
663
|
+
public void generateRewardVerificationToken(String impressionId, final Promise promise) {
|
|
664
|
+
promise.resolve(convertMapToWriteableMap(CommonKt.generateRewardVerificationToken(impressionId)));
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
@ReactMethod
|
|
668
|
+
public void pollRewardVerification(String clientTransactionId, final Promise promise) {
|
|
669
|
+
CommonKt.pollRewardVerification(clientTransactionId, getOnResult(promise));
|
|
670
|
+
}
|
|
671
|
+
|
|
658
672
|
// endregion
|
|
659
673
|
|
|
660
674
|
//================================================================================
|
|
@@ -3,7 +3,7 @@ import { MakePurchaseResult } from '@revenuecat/purchases-typescript-internal';
|
|
|
3
3
|
* Browser implementation of the native module. This will be used in the browser and Expo Go.
|
|
4
4
|
*/
|
|
5
5
|
export declare const browserNativeModuleRNPurchases: {
|
|
6
|
-
setupPurchases: (apiKey: string, appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _store: string | null, _galaxyBillingMode: string | null, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean, _automaticDeviceIdentifierCollectionEnabled: boolean, _preferredUILocaleOverride: string | null) => void;
|
|
6
|
+
setupPurchases: (apiKey: string, appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _store: string | null, _galaxyBillingMode: string | null, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean, _automaticDeviceIdentifierCollectionEnabled: boolean, _preferredUILocaleOverride: string | null, _useWorkflows: boolean) => void;
|
|
7
7
|
setAllowSharingStoreAccount: (_allowSharing: boolean) => Promise<void>;
|
|
8
8
|
setSimulatesAskToBuyInSandbox: (_simulatesAskToBuyInSandbox: boolean) => Promise<void>;
|
|
9
9
|
getOfferings: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
|
|
@@ -90,4 +90,6 @@ export declare const browserNativeModuleRNPurchases: {
|
|
|
90
90
|
trackAdLoaded: (_data: any) => Promise<void>;
|
|
91
91
|
trackAdRevenue: (_data: any) => Promise<void>;
|
|
92
92
|
trackAdFailedToLoad: (_data: any) => Promise<void>;
|
|
93
|
+
generateRewardVerificationToken: (_impressionId: string) => Promise<void>;
|
|
94
|
+
pollRewardVerification: (_clientTransactionId: string) => Promise<void>;
|
|
93
95
|
};
|
|
@@ -48,7 +48,7 @@ var packageVersion = '9.1.0';
|
|
|
48
48
|
* Browser implementation of the native module. This will be used in the browser and Expo Go.
|
|
49
49
|
*/
|
|
50
50
|
exports.browserNativeModuleRNPurchases = {
|
|
51
|
-
setupPurchases: function (apiKey, appUserID, _purchasesAreCompletedBy, _userDefaultsSuiteName, _storeKitVersion, _useAmazon, _store, _galaxyBillingMode, _shouldShowInAppMessagesAutomatically, _entitlementVerificationMode, _pendingTransactionsForPrepaidPlansEnabled, _diagnosticsEnabled, _automaticDeviceIdentifierCollectionEnabled, _preferredUILocaleOverride) {
|
|
51
|
+
setupPurchases: function (apiKey, appUserID, _purchasesAreCompletedBy, _userDefaultsSuiteName, _storeKitVersion, _useAmazon, _store, _galaxyBillingMode, _shouldShowInAppMessagesAutomatically, _entitlementVerificationMode, _pendingTransactionsForPrepaidPlansEnabled, _diagnosticsEnabled, _automaticDeviceIdentifierCollectionEnabled, _preferredUILocaleOverride, _useWorkflows) {
|
|
52
52
|
try {
|
|
53
53
|
// Make sure that when running in Expo Go or Rork sandbox a web-compatible API key is used, because the underlying purchases-js error message isn't super clear when a non-compatible API key type is used in this case
|
|
54
54
|
var webPlatformCompatibleApiKeyPrefixList = ['test_', 'rcb_'];
|
|
@@ -633,4 +633,16 @@ exports.browserNativeModuleRNPurchases = {
|
|
|
633
633
|
return [2 /*return*/];
|
|
634
634
|
});
|
|
635
635
|
}); },
|
|
636
|
+
generateRewardVerificationToken: function (_impressionId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
637
|
+
return __generator(this, function (_a) {
|
|
638
|
+
(0, utils_1.methodNotSupportedOnWeb)('generateRewardVerificationToken');
|
|
639
|
+
return [2 /*return*/];
|
|
640
|
+
});
|
|
641
|
+
}); },
|
|
642
|
+
pollRewardVerification: function (_clientTransactionId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
643
|
+
return __generator(this, function (_a) {
|
|
644
|
+
(0, utils_1.methodNotSupportedOnWeb)('pollRewardVerification');
|
|
645
|
+
return [2 /*return*/];
|
|
646
|
+
});
|
|
647
|
+
}); },
|
|
636
648
|
};
|
package/dist/purchases.d.ts
CHANGED
|
@@ -125,6 +125,57 @@ export interface AdFailedToLoadData {
|
|
|
125
125
|
mediatorErrorCode?: number | null;
|
|
126
126
|
placement?: string | null;
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Token generated for a rewarded ad impression. Pass `clientTransactionId` to
|
|
130
|
+
* the ad network as server-side verification custom data, then to
|
|
131
|
+
* {@link Purchases.pollRewardVerification} to await the reward.
|
|
132
|
+
* @beta
|
|
133
|
+
*/
|
|
134
|
+
export interface RewardVerificationToken {
|
|
135
|
+
customData: string;
|
|
136
|
+
clientTransactionId: string;
|
|
137
|
+
appUserID: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A reward granted after a verified rewarded ad. Discriminated by `type`.
|
|
141
|
+
* @beta
|
|
142
|
+
*/
|
|
143
|
+
export type VerifiedReward = VerifiedVirtualCurrencyReward | VerifiedEntitlementReward | VerifiedNoReward | VerifiedUnsupportedReward;
|
|
144
|
+
/** @beta */
|
|
145
|
+
export interface VerifiedVirtualCurrencyReward {
|
|
146
|
+
type: "virtual_currency";
|
|
147
|
+
code: string;
|
|
148
|
+
amount: number;
|
|
149
|
+
}
|
|
150
|
+
/** @beta */
|
|
151
|
+
export interface VerifiedEntitlementReward {
|
|
152
|
+
type: "entitlement";
|
|
153
|
+
identifier: string;
|
|
154
|
+
/** ISO 8601 expiration date string. */
|
|
155
|
+
expiresAt: string;
|
|
156
|
+
/** Expiration date in milliseconds since epoch. */
|
|
157
|
+
expiresAtMillis: number;
|
|
158
|
+
}
|
|
159
|
+
/** Verification completed but nothing was granted. @beta */
|
|
160
|
+
export interface VerifiedNoReward {
|
|
161
|
+
type: "no_reward";
|
|
162
|
+
}
|
|
163
|
+
/** Verification completed but the reward type isn't modeled by this SDK version. @beta */
|
|
164
|
+
export interface VerifiedUnsupportedReward {
|
|
165
|
+
type: "unsupported_reward";
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Result of polling for reward verification.
|
|
169
|
+
* @beta
|
|
170
|
+
*/
|
|
171
|
+
export interface RewardVerificationResult {
|
|
172
|
+
/** The primary reward when verification succeeded; absent on failure. */
|
|
173
|
+
reward?: VerifiedReward;
|
|
174
|
+
/** Additional rewards granted alongside the primary; never repeats it; empty on failure. */
|
|
175
|
+
moreRewards: VerifiedReward[];
|
|
176
|
+
/** True when verification did not complete (rejected / timeout / network). */
|
|
177
|
+
failed: boolean;
|
|
178
|
+
}
|
|
128
179
|
export default class Purchases {
|
|
129
180
|
/**
|
|
130
181
|
* Supported SKU types.
|
|
@@ -1007,6 +1058,31 @@ export default class Purchases {
|
|
|
1007
1058
|
* the SDK will use the current offering identifier from the cache.
|
|
1008
1059
|
*/
|
|
1009
1060
|
static trackCustomPaywallImpression(params?: TrackCustomPaywallImpressionOptions): Promise<void>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Generates a reward verification token for a rewarded ad impression.
|
|
1063
|
+
*
|
|
1064
|
+
* Pass the returned `clientTransactionId` to the ad network as the
|
|
1065
|
+
* server-side verification custom data. After the ad completes, pass the same
|
|
1066
|
+
* id to {@link Purchases.pollRewardVerification} to await the reward.
|
|
1067
|
+
*
|
|
1068
|
+
* @param impressionId - The impression identifier of the rewarded ad.
|
|
1069
|
+
* @returns {Promise<RewardVerificationToken>} promise with the generated token.
|
|
1070
|
+
* @beta
|
|
1071
|
+
*/
|
|
1072
|
+
static generateRewardVerificationToken(impressionId: string): Promise<RewardVerificationToken>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Polls RevenueCat for the reward verification result of a rewarded ad.
|
|
1075
|
+
*
|
|
1076
|
+
* The returned promise stays pending while the native poller runs (up to
|
|
1077
|
+
* ~10-30s) and resolves once verification completes or times out. A timed-out
|
|
1078
|
+
* or rejected verification resolves with `failed: true` rather than rejecting.
|
|
1079
|
+
*
|
|
1080
|
+
* @param clientTransactionId - The `clientTransactionId` from
|
|
1081
|
+
* {@link Purchases.generateRewardVerificationToken}.
|
|
1082
|
+
* @returns {Promise<RewardVerificationResult>} promise with the verification result.
|
|
1083
|
+
* @beta
|
|
1084
|
+
*/
|
|
1085
|
+
static pollRewardVerification(clientTransactionId: string): Promise<RewardVerificationResult>;
|
|
1010
1086
|
private static throwIfAndroidPlatform;
|
|
1011
1087
|
private static throwIfIOSPlatform;
|
|
1012
1088
|
private static isPurchasesAreCompletedByMyApp;
|
package/dist/purchases.js
CHANGED
|
@@ -172,8 +172,9 @@ var Purchases = /** @class */ (function () {
|
|
|
172
172
|
* @warning If you use purchasesAreCompletedBy=PurchasesAreCompletedByMyApp, you must also provide a value for storeKitVersion.
|
|
173
173
|
*/
|
|
174
174
|
Purchases.configure = function (configuration) {
|
|
175
|
-
var
|
|
176
|
-
var
|
|
175
|
+
var _a;
|
|
176
|
+
var apiKey = configuration.apiKey, _b = configuration.appUserID, appUserID = _b === void 0 ? null : _b, _c = configuration.purchasesAreCompletedBy, purchasesAreCompletedBy = _c === void 0 ? purchases_typescript_internal_1.PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT : _c, userDefaultsSuiteName = configuration.userDefaultsSuiteName, _d = configuration.storeKitVersion, storeKitVersion = _d === void 0 ? purchases_typescript_internal_1.STOREKIT_VERSION.DEFAULT : _d, _e = configuration.useAmazon, useAmazon = _e === void 0 ? false : _e, _f = configuration.shouldShowInAppMessagesAutomatically, shouldShowInAppMessagesAutomatically = _f === void 0 ? true : _f, _g = configuration.entitlementVerificationMode, entitlementVerificationMode = _g === void 0 ? purchases_typescript_internal_1.ENTITLEMENT_VERIFICATION_MODE.DISABLED : _g, _h = configuration.pendingTransactionsForPrepaidPlansEnabled, pendingTransactionsForPrepaidPlansEnabled = _h === void 0 ? false : _h, _j = configuration.diagnosticsEnabled, diagnosticsEnabled = _j === void 0 ? false : _j, _k = configuration.automaticDeviceIdentifierCollectionEnabled, automaticDeviceIdentifierCollectionEnabled = _k === void 0 ? true : _k, preferredUILocaleOverride = configuration.preferredUILocaleOverride, dangerousSettings = configuration.dangerousSettings;
|
|
177
|
+
var _l = configuration, store = _l.store, galaxyBillingMode = _l.galaxyBillingMode;
|
|
177
178
|
throwIfNativeModuleNotAvailable();
|
|
178
179
|
if (!customLogHandler) {
|
|
179
180
|
this.setLogHandler(function (logLevel, message) {
|
|
@@ -226,7 +227,8 @@ var Purchases = /** @class */ (function () {
|
|
|
226
227
|
console.warn("Warning: You should provide the specific StoreKit version you're using in your implementation when configuring PURCHASES_ARE_COMPLETED_BY_TYPE.MY_APP, and not rely on the DEFAULT.");
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
|
|
230
|
+
var useWorkflows = (_a = dangerousSettings === null || dangerousSettings === void 0 ? void 0 : dangerousSettings.useWorkflows) !== null && _a !== void 0 ? _a : false;
|
|
231
|
+
RNPurchases.setupPurchases(apiKey, appUserID, purchasesCompletedByToUse, userDefaultsSuiteName, storeKitVersionToUse, useAmazon, store, galaxyBillingMode, shouldShowInAppMessagesAutomatically, entitlementVerificationMode, pendingTransactionsForPrepaidPlansEnabled, diagnosticsEnabled, automaticDeviceIdentifierCollectionEnabled, preferredUILocaleOverride, useWorkflows);
|
|
230
232
|
};
|
|
231
233
|
/**
|
|
232
234
|
* @deprecated, configure behavior through the RevenueCat dashboard (app.revenuecat.com) instead.
|
|
@@ -2091,6 +2093,53 @@ var Purchases = /** @class */ (function () {
|
|
|
2091
2093
|
});
|
|
2092
2094
|
});
|
|
2093
2095
|
};
|
|
2096
|
+
/**
|
|
2097
|
+
* Generates a reward verification token for a rewarded ad impression.
|
|
2098
|
+
*
|
|
2099
|
+
* Pass the returned `clientTransactionId` to the ad network as the
|
|
2100
|
+
* server-side verification custom data. After the ad completes, pass the same
|
|
2101
|
+
* id to {@link Purchases.pollRewardVerification} to await the reward.
|
|
2102
|
+
*
|
|
2103
|
+
* @param impressionId - The impression identifier of the rewarded ad.
|
|
2104
|
+
* @returns {Promise<RewardVerificationToken>} promise with the generated token.
|
|
2105
|
+
* @beta
|
|
2106
|
+
*/
|
|
2107
|
+
Purchases.generateRewardVerificationToken = function (impressionId) {
|
|
2108
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2109
|
+
return __generator(this, function (_a) {
|
|
2110
|
+
switch (_a.label) {
|
|
2111
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
2112
|
+
case 1:
|
|
2113
|
+
_a.sent();
|
|
2114
|
+
return [2 /*return*/, RNPurchases.generateRewardVerificationToken(impressionId)];
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
});
|
|
2118
|
+
};
|
|
2119
|
+
/**
|
|
2120
|
+
* Polls RevenueCat for the reward verification result of a rewarded ad.
|
|
2121
|
+
*
|
|
2122
|
+
* The returned promise stays pending while the native poller runs (up to
|
|
2123
|
+
* ~10-30s) and resolves once verification completes or times out. A timed-out
|
|
2124
|
+
* or rejected verification resolves with `failed: true` rather than rejecting.
|
|
2125
|
+
*
|
|
2126
|
+
* @param clientTransactionId - The `clientTransactionId` from
|
|
2127
|
+
* {@link Purchases.generateRewardVerificationToken}.
|
|
2128
|
+
* @returns {Promise<RewardVerificationResult>} promise with the verification result.
|
|
2129
|
+
* @beta
|
|
2130
|
+
*/
|
|
2131
|
+
Purchases.pollRewardVerification = function (clientTransactionId) {
|
|
2132
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2133
|
+
return __generator(this, function (_a) {
|
|
2134
|
+
switch (_a.label) {
|
|
2135
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
2136
|
+
case 1:
|
|
2137
|
+
_a.sent();
|
|
2138
|
+
return [2 /*return*/, RNPurchases.pollRewardVerification(clientTransactionId)];
|
|
2139
|
+
}
|
|
2140
|
+
});
|
|
2141
|
+
});
|
|
2142
|
+
};
|
|
2094
2143
|
Purchases.throwIfAndroidPlatform = function () {
|
|
2095
2144
|
return __awaiter(this, void 0, void 0, function () {
|
|
2096
2145
|
return __generator(this, function (_a) {
|
|
@@ -7,3 +7,14 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
import Foundation
|
|
10
|
+
@_spi(Internal) import RevenueCat
|
|
11
|
+
|
|
12
|
+
/// Builds `DangerousSettings` for the React Native bridge. Lives in Swift because `useWorkflows`
|
|
13
|
+
/// is an internal `@_spi(Internal)` flag that isn't reachable from the Objective-C bridge.
|
|
14
|
+
@objc public class RNPurchasesDangerousSettingsFactory: NSObject {
|
|
15
|
+
|
|
16
|
+
@objc public static func make(useWorkflows: Bool) -> DangerousSettings {
|
|
17
|
+
return useWorkflows ? DangerousSettings(useWorkflows: true) : DangerousSettings()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
package/ios/RNPurchases.m
CHANGED
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
#import "RNPurchases.h"
|
|
8
8
|
|
|
9
|
+
#if __has_include("RNPurchases-Swift.h")
|
|
10
|
+
#import "RNPurchases-Swift.h"
|
|
11
|
+
#else
|
|
12
|
+
#import <RNPurchases/RNPurchases-Swift.h>
|
|
13
|
+
#endif
|
|
14
|
+
|
|
9
15
|
@import StoreKit;
|
|
10
16
|
|
|
11
17
|
typedef void (^PurchaseCompletedBlock)(RCStoreTransaction *, RCCustomerInfo *, NSError *, BOOL);
|
|
@@ -89,7 +95,9 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
|
|
|
89
95
|
pendingTransactionsForPrepaidPlansEnabled:(BOOL)pendingTransactionsForPrepaidPlansEnabled
|
|
90
96
|
diagnosticsEnabled:(BOOL)diagnosticsEnabled
|
|
91
97
|
automaticDeviceIdentifierCollectionEnabled:(BOOL)automaticDeviceIdentifierCollectionEnabled
|
|
92
|
-
preferredUILocaleOverride:(nullable NSString *)preferredUILocaleOverride
|
|
98
|
+
preferredUILocaleOverride:(nullable NSString *)preferredUILocaleOverride
|
|
99
|
+
useWorkflows:(BOOL)useWorkflows) {
|
|
100
|
+
RCDangerousSettings *dangerousSettings = [RNPurchasesDangerousSettingsFactory makeWithUseWorkflows:useWorkflows];
|
|
93
101
|
RCPurchases *purchases = [RCPurchases configureWithAPIKey:apiKey.mappingNSNullToNil
|
|
94
102
|
appUserID:appUserID.mappingNSNullToNil
|
|
95
103
|
purchasesAreCompletedBy:purchasesAreCompletedBy.mappingNSNullToNil
|
|
@@ -97,7 +105,7 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
|
|
|
97
105
|
platformFlavor:self.platformFlavor
|
|
98
106
|
platformFlavorVersion:self.platformFlavorVersion
|
|
99
107
|
storeKitVersion:storeKitVersion.mappingNSNullToNil
|
|
100
|
-
dangerousSettings:
|
|
108
|
+
dangerousSettings:dangerousSettings
|
|
101
109
|
shouldShowInAppMessagesAutomatically:shouldShowInAppMessagesAutomatically
|
|
102
110
|
verificationMode:entitlementVerificationMode.mappingNSNullToNil
|
|
103
111
|
diagnosticsEnabled:diagnosticsEnabled
|
|
@@ -703,6 +711,20 @@ RCT_EXPORT_METHOD(trackAdFailedToLoad:(NSDictionary *)data) {
|
|
|
703
711
|
}
|
|
704
712
|
}
|
|
705
713
|
|
|
714
|
+
RCT_EXPORT_METHOD(generateRewardVerificationToken:(NSString *)impressionId
|
|
715
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
716
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
717
|
+
resolve([RCCommonFunctionality generateRewardVerificationTokenWithImpressionId:impressionId]);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
RCT_EXPORT_METHOD(pollRewardVerification:(NSString *)clientTransactionId
|
|
721
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
722
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
723
|
+
[RCCommonFunctionality pollRewardVerificationWithClientTransactionId:clientTransactionId
|
|
724
|
+
completion:[self getResponseCompletionBlockWithResolve:resolve
|
|
725
|
+
reject:reject]];
|
|
726
|
+
}
|
|
727
|
+
|
|
706
728
|
#pragma mark -
|
|
707
729
|
#pragma mark Delegate Methods
|
|
708
730
|
- (void)purchases:(RCPurchases *)purchases receivedUpdatedCustomerInfo:(RCCustomerInfo *)customerInfo {
|
|
@@ -765,7 +787,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
|
|
|
765
787
|
}
|
|
766
788
|
|
|
767
789
|
- (NSString *)platformFlavorVersion {
|
|
768
|
-
return @"10.
|
|
790
|
+
return @"10.5.0";
|
|
769
791
|
}
|
|
770
792
|
|
|
771
793
|
@end
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-purchases",
|
|
3
3
|
"title": "React Native Purchases",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.5.0",
|
|
5
5
|
"description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android. ",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
]
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@revenuecat/purchases-js-hybrid-mappings": "18.
|
|
122
|
-
"@revenuecat/purchases-typescript-internal": "18.
|
|
121
|
+
"@revenuecat/purchases-js-hybrid-mappings": "18.26.0",
|
|
122
|
+
"@revenuecat/purchases-typescript-internal": "18.26.0"
|
|
123
123
|
}
|
|
124
124
|
}
|