react-native-purchases 10.1.1 → 10.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.
- package/RNPurchases.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +26 -1
- package/dist/browser/nativeModule.d.ts +5 -0
- package/dist/browser/nativeModule.js +30 -0
- package/dist/purchases.d.ts +101 -1
- package/dist/purchases.js +208 -86
- package/ios/RNPurchases.m +41 -1
- 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.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:18.
|
|
124
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.8.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.2.0";
|
|
55
55
|
|
|
56
56
|
private final ReactApplicationContext reactContext;
|
|
57
57
|
|
|
@@ -626,6 +626,31 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
626
626
|
CommonKt.trackCustomPaywallImpression(data.toHashMap());
|
|
627
627
|
}
|
|
628
628
|
|
|
629
|
+
@ReactMethod
|
|
630
|
+
public void trackAdDisplayed(ReadableMap data) {
|
|
631
|
+
CommonKt.trackAdDisplayed(data.toHashMap());
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
@ReactMethod
|
|
635
|
+
public void trackAdOpened(ReadableMap data) {
|
|
636
|
+
CommonKt.trackAdOpened(data.toHashMap());
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
@ReactMethod
|
|
640
|
+
public void trackAdLoaded(ReadableMap data) {
|
|
641
|
+
CommonKt.trackAdLoaded(data.toHashMap());
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
@ReactMethod
|
|
645
|
+
public void trackAdRevenue(ReadableMap data) {
|
|
646
|
+
CommonKt.trackAdRevenue(data.toHashMap());
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
@ReactMethod
|
|
650
|
+
public void trackAdFailedToLoad(ReadableMap data) {
|
|
651
|
+
CommonKt.trackAdFailedToLoad(data.toHashMap());
|
|
652
|
+
}
|
|
653
|
+
|
|
629
654
|
// endregion
|
|
630
655
|
|
|
631
656
|
//================================================================================
|
|
@@ -83,4 +83,9 @@ export declare const browserNativeModuleRNPurchases: {
|
|
|
83
83
|
getVirtualCurrencies: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesVirtualCurrencies>;
|
|
84
84
|
invalidateVirtualCurrenciesCache: () => Promise<void>;
|
|
85
85
|
getCachedVirtualCurrencies: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesVirtualCurrencies | null>;
|
|
86
|
+
trackAdDisplayed: (_data: any) => Promise<void>;
|
|
87
|
+
trackAdOpened: (_data: any) => Promise<void>;
|
|
88
|
+
trackAdLoaded: (_data: any) => Promise<void>;
|
|
89
|
+
trackAdRevenue: (_data: any) => Promise<void>;
|
|
90
|
+
trackAdFailedToLoad: (_data: any) => Promise<void>;
|
|
86
91
|
};
|
|
@@ -591,4 +591,34 @@ exports.browserNativeModuleRNPurchases = {
|
|
|
591
591
|
return [2 /*return*/, cachedVirtualCurrencies ? (0, typeGuards_1.validateAndTransform)(cachedVirtualCurrencies, typeGuards_1.isPurchasesVirtualCurrencies, 'PurchasesVirtualCurrencies') : null];
|
|
592
592
|
});
|
|
593
593
|
}); },
|
|
594
|
+
trackAdDisplayed: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
595
|
+
return __generator(this, function (_a) {
|
|
596
|
+
(0, utils_1.methodNotSupportedOnWeb)('trackAdDisplayed');
|
|
597
|
+
return [2 /*return*/];
|
|
598
|
+
});
|
|
599
|
+
}); },
|
|
600
|
+
trackAdOpened: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
601
|
+
return __generator(this, function (_a) {
|
|
602
|
+
(0, utils_1.methodNotSupportedOnWeb)('trackAdOpened');
|
|
603
|
+
return [2 /*return*/];
|
|
604
|
+
});
|
|
605
|
+
}); },
|
|
606
|
+
trackAdLoaded: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
607
|
+
return __generator(this, function (_a) {
|
|
608
|
+
(0, utils_1.methodNotSupportedOnWeb)('trackAdLoaded');
|
|
609
|
+
return [2 /*return*/];
|
|
610
|
+
});
|
|
611
|
+
}); },
|
|
612
|
+
trackAdRevenue: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
613
|
+
return __generator(this, function (_a) {
|
|
614
|
+
(0, utils_1.methodNotSupportedOnWeb)('trackAdRevenue');
|
|
615
|
+
return [2 /*return*/];
|
|
616
|
+
});
|
|
617
|
+
}); },
|
|
618
|
+
trackAdFailedToLoad: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
619
|
+
return __generator(this, function (_a) {
|
|
620
|
+
(0, utils_1.methodNotSupportedOnWeb)('trackAdFailedToLoad');
|
|
621
|
+
return [2 /*return*/];
|
|
622
|
+
});
|
|
623
|
+
}); },
|
|
594
624
|
};
|
package/dist/purchases.d.ts
CHANGED
|
@@ -20,6 +20,90 @@ export interface TrackCustomPaywallImpressionOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
offeringId?: string | null;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Predefined mediator name constants. Use these or pass any string for unlisted networks.
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
export declare const AdMediatorName: {
|
|
28
|
+
readonly adMob: "AdMob";
|
|
29
|
+
readonly appLovin: "AppLovin";
|
|
30
|
+
};
|
|
31
|
+
/** @beta */
|
|
32
|
+
export type AdMediatorName = string;
|
|
33
|
+
/**
|
|
34
|
+
* Predefined ad format constants. Use these or pass any string for unlisted formats.
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
export declare const AdFormat: {
|
|
38
|
+
readonly other: "other";
|
|
39
|
+
readonly banner: "banner";
|
|
40
|
+
readonly interstitial: "interstitial";
|
|
41
|
+
readonly rewarded: "rewarded";
|
|
42
|
+
readonly rewardedInterstitial: "rewarded_interstitial";
|
|
43
|
+
readonly nativeAd: "native";
|
|
44
|
+
readonly appOpen: "app_open";
|
|
45
|
+
};
|
|
46
|
+
/** @beta */
|
|
47
|
+
export type AdFormat = string;
|
|
48
|
+
/**
|
|
49
|
+
* Predefined precision constants for ad revenue. Use these or pass any string for unlisted values.
|
|
50
|
+
* @beta
|
|
51
|
+
*/
|
|
52
|
+
export declare const AdRevenuePrecision: {
|
|
53
|
+
readonly exact: "exact";
|
|
54
|
+
readonly publisherDefined: "publisher_defined";
|
|
55
|
+
readonly estimated: "estimated";
|
|
56
|
+
readonly unknown: "unknown";
|
|
57
|
+
};
|
|
58
|
+
/** @beta */
|
|
59
|
+
export type AdRevenuePrecision = string;
|
|
60
|
+
/** @beta */
|
|
61
|
+
export interface AdDisplayedData {
|
|
62
|
+
mediatorName: AdMediatorName;
|
|
63
|
+
adFormat: AdFormat;
|
|
64
|
+
adUnitId: string;
|
|
65
|
+
impressionId: string;
|
|
66
|
+
networkName?: string | null;
|
|
67
|
+
placement?: string | null;
|
|
68
|
+
}
|
|
69
|
+
/** @beta */
|
|
70
|
+
export interface AdOpenedData {
|
|
71
|
+
mediatorName: AdMediatorName;
|
|
72
|
+
adFormat: AdFormat;
|
|
73
|
+
adUnitId: string;
|
|
74
|
+
impressionId: string;
|
|
75
|
+
networkName?: string | null;
|
|
76
|
+
placement?: string | null;
|
|
77
|
+
}
|
|
78
|
+
/** @beta */
|
|
79
|
+
export interface AdLoadedData {
|
|
80
|
+
mediatorName: AdMediatorName;
|
|
81
|
+
adFormat: AdFormat;
|
|
82
|
+
adUnitId: string;
|
|
83
|
+
impressionId: string;
|
|
84
|
+
networkName?: string | null;
|
|
85
|
+
placement?: string | null;
|
|
86
|
+
}
|
|
87
|
+
/** @beta */
|
|
88
|
+
export interface AdRevenueData {
|
|
89
|
+
mediatorName: AdMediatorName;
|
|
90
|
+
adFormat: AdFormat;
|
|
91
|
+
adUnitId: string;
|
|
92
|
+
impressionId: string;
|
|
93
|
+
revenueMicros: number;
|
|
94
|
+
currency: string;
|
|
95
|
+
precision: AdRevenuePrecision;
|
|
96
|
+
networkName?: string | null;
|
|
97
|
+
placement?: string | null;
|
|
98
|
+
}
|
|
99
|
+
/** @beta */
|
|
100
|
+
export interface AdFailedToLoadData {
|
|
101
|
+
mediatorName: AdMediatorName;
|
|
102
|
+
adFormat: AdFormat;
|
|
103
|
+
adUnitId: string;
|
|
104
|
+
mediatorErrorCode?: number | null;
|
|
105
|
+
placement?: string | null;
|
|
106
|
+
}
|
|
23
107
|
export default class Purchases {
|
|
24
108
|
/**
|
|
25
109
|
* Supported SKU types.
|
|
@@ -865,6 +949,11 @@ export default class Purchases {
|
|
|
865
949
|
* @returns {Promise<Boolean>} promise with boolean response
|
|
866
950
|
*/
|
|
867
951
|
static isConfigured(): Promise<boolean>;
|
|
952
|
+
/**
|
|
953
|
+
* Provides access to ad lifecycle tracking methods.
|
|
954
|
+
* @beta
|
|
955
|
+
*/
|
|
956
|
+
static get adTracker(): PurchasesAdTracker;
|
|
868
957
|
/**
|
|
869
958
|
* Tracks an impression of a custom (non-RevenueCat) paywall.
|
|
870
959
|
* Call this method when your custom paywall is displayed to a user.
|
|
@@ -876,9 +965,20 @@ export default class Purchases {
|
|
|
876
965
|
* If not provided, the SDK will use the current offering identifier from the cache.
|
|
877
966
|
*/
|
|
878
967
|
static trackCustomPaywallImpression(params?: TrackCustomPaywallImpressionOptions): Promise<void>;
|
|
879
|
-
private static throwIfNotConfigured;
|
|
880
968
|
private static throwIfAndroidPlatform;
|
|
881
969
|
private static throwIfIOSPlatform;
|
|
882
970
|
private static isPurchasesAreCompletedByMyApp;
|
|
883
971
|
private static convertIntToRefundRequestStatus;
|
|
884
972
|
}
|
|
973
|
+
/**
|
|
974
|
+
* Provides methods for tracking ad lifecycle events.
|
|
975
|
+
* Access via {@link Purchases.adTracker}.
|
|
976
|
+
* @beta
|
|
977
|
+
*/
|
|
978
|
+
export declare class PurchasesAdTracker {
|
|
979
|
+
trackAdDisplayed(data: AdDisplayedData): Promise<void>;
|
|
980
|
+
trackAdOpened(data: AdOpenedData): Promise<void>;
|
|
981
|
+
trackAdLoaded(data: AdLoadedData): Promise<void>;
|
|
982
|
+
trackAdRevenue(data: AdRevenueData): Promise<void>;
|
|
983
|
+
trackAdFailedToLoad(data: AdFailedToLoadData): Promise<void>;
|
|
984
|
+
}
|
package/dist/purchases.js
CHANGED
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.WebPurchaseRedemptionResultType = exports.STOREKIT_VERSION = exports.LOG_LEVEL = exports.REFUND_REQUEST_STATUS = exports.BILLING_FEATURE = exports.PURCHASES_ARE_COMPLETED_BY_TYPE = exports.PURCHASE_TYPE = void 0;
|
|
39
|
+
exports.PurchasesAdTracker = exports.AdRevenuePrecision = exports.AdFormat = exports.AdMediatorName = exports.WebPurchaseRedemptionResultType = exports.STOREKIT_VERSION = exports.LOG_LEVEL = exports.REFUND_REQUEST_STATUS = exports.BILLING_FEATURE = exports.PURCHASES_ARE_COMPLETED_BY_TYPE = exports.PURCHASE_TYPE = void 0;
|
|
40
40
|
var react_native_1 = require("react-native");
|
|
41
41
|
var purchases_typescript_internal_1 = require("@revenuecat/purchases-typescript-internal");
|
|
42
42
|
var environment_1 = require("./utils/environment");
|
|
@@ -75,6 +75,37 @@ var customerInfoUpdateListeners = [];
|
|
|
75
75
|
var shouldPurchasePromoProductListeners = [];
|
|
76
76
|
var customLogHandler;
|
|
77
77
|
var trackedEventListeners = [];
|
|
78
|
+
/**
|
|
79
|
+
* Predefined mediator name constants. Use these or pass any string for unlisted networks.
|
|
80
|
+
* @beta
|
|
81
|
+
*/
|
|
82
|
+
exports.AdMediatorName = {
|
|
83
|
+
adMob: "AdMob",
|
|
84
|
+
appLovin: "AppLovin",
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Predefined ad format constants. Use these or pass any string for unlisted formats.
|
|
88
|
+
* @beta
|
|
89
|
+
*/
|
|
90
|
+
exports.AdFormat = {
|
|
91
|
+
other: "other",
|
|
92
|
+
banner: "banner",
|
|
93
|
+
interstitial: "interstitial",
|
|
94
|
+
rewarded: "rewarded",
|
|
95
|
+
rewardedInterstitial: "rewarded_interstitial",
|
|
96
|
+
nativeAd: "native",
|
|
97
|
+
appOpen: "app_open",
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Predefined precision constants for ad revenue. Use these or pass any string for unlisted values.
|
|
101
|
+
* @beta
|
|
102
|
+
*/
|
|
103
|
+
exports.AdRevenuePrecision = {
|
|
104
|
+
exact: "exact",
|
|
105
|
+
publisherDefined: "publisher_defined",
|
|
106
|
+
estimated: "estimated",
|
|
107
|
+
unknown: "unknown",
|
|
108
|
+
};
|
|
78
109
|
var debugEventListeners = [];
|
|
79
110
|
eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.addListener("Purchases-CustomerInfoUpdated", function (customerInfo) {
|
|
80
111
|
customerInfoUpdateListeners.forEach(function (listener) { return listener(customerInfo); });
|
|
@@ -98,6 +129,22 @@ eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.addList
|
|
|
98
129
|
eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.addListener("Purchases-DebugEvent", function (eventDictionary) {
|
|
99
130
|
debugEventListeners.forEach(function (listener) { return listener({ eventDictionary: eventDictionary }); });
|
|
100
131
|
});
|
|
132
|
+
function throwIfNotConfigured() {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
var isConfigured;
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0: return [4 /*yield*/, Purchases.isConfigured()];
|
|
138
|
+
case 1:
|
|
139
|
+
isConfigured = _a.sent();
|
|
140
|
+
if (!isConfigured) {
|
|
141
|
+
throw new purchases_typescript_internal_1.UninitializedPurchasesError();
|
|
142
|
+
}
|
|
143
|
+
return [2 /*return*/];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
101
148
|
var Purchases = /** @class */ (function () {
|
|
102
149
|
function Purchases() {
|
|
103
150
|
}
|
|
@@ -189,7 +236,7 @@ var Purchases = /** @class */ (function () {
|
|
|
189
236
|
return __awaiter(this, void 0, void 0, function () {
|
|
190
237
|
return __generator(this, function (_a) {
|
|
191
238
|
switch (_a.label) {
|
|
192
|
-
case 0: return [4 /*yield*/,
|
|
239
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
193
240
|
case 1:
|
|
194
241
|
_a.sent();
|
|
195
242
|
RNPurchases.setAllowSharingStoreAccount(allowSharing);
|
|
@@ -274,7 +321,7 @@ var Purchases = /** @class */ (function () {
|
|
|
274
321
|
return __awaiter(this, void 0, void 0, function () {
|
|
275
322
|
return __generator(this, function (_a) {
|
|
276
323
|
switch (_a.label) {
|
|
277
|
-
case 0: return [4 /*yield*/,
|
|
324
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
278
325
|
case 1:
|
|
279
326
|
_a.sent();
|
|
280
327
|
return [2 /*return*/, RNPurchases.getOfferings()];
|
|
@@ -293,7 +340,7 @@ var Purchases = /** @class */ (function () {
|
|
|
293
340
|
return __awaiter(this, void 0, void 0, function () {
|
|
294
341
|
return __generator(this, function (_a) {
|
|
295
342
|
switch (_a.label) {
|
|
296
|
-
case 0: return [4 /*yield*/,
|
|
343
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
297
344
|
case 1:
|
|
298
345
|
_a.sent();
|
|
299
346
|
return [2 /*return*/, RNPurchases.getCurrentOfferingForPlacement(placementIdentifier)];
|
|
@@ -312,7 +359,7 @@ var Purchases = /** @class */ (function () {
|
|
|
312
359
|
return __awaiter(this, void 0, void 0, function () {
|
|
313
360
|
return __generator(this, function (_a) {
|
|
314
361
|
switch (_a.label) {
|
|
315
|
-
case 0: return [4 /*yield*/,
|
|
362
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
316
363
|
case 1:
|
|
317
364
|
_a.sent();
|
|
318
365
|
return [2 /*return*/, RNPurchases.syncAttributesAndOfferingsIfNeeded()];
|
|
@@ -334,7 +381,7 @@ var Purchases = /** @class */ (function () {
|
|
|
334
381
|
return __awaiter(this, void 0, void 0, function () {
|
|
335
382
|
return __generator(this, function (_a) {
|
|
336
383
|
switch (_a.label) {
|
|
337
|
-
case 0: return [4 /*yield*/,
|
|
384
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
338
385
|
case 1:
|
|
339
386
|
_a.sent();
|
|
340
387
|
return [2 /*return*/, RNPurchases.setAppstackAttributionParams(data)];
|
|
@@ -356,7 +403,7 @@ var Purchases = /** @class */ (function () {
|
|
|
356
403
|
if (type === void 0) { type = purchases_typescript_internal_1.PRODUCT_CATEGORY.SUBSCRIPTION; }
|
|
357
404
|
return __generator(this, function (_a) {
|
|
358
405
|
switch (_a.label) {
|
|
359
|
-
case 0: return [4 /*yield*/,
|
|
406
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
360
407
|
case 1:
|
|
361
408
|
_a.sent();
|
|
362
409
|
return [2 /*return*/, RNPurchases.getProductInfo(productIdentifiers, type)];
|
|
@@ -378,7 +425,7 @@ var Purchases = /** @class */ (function () {
|
|
|
378
425
|
if (type === void 0) { type = purchases_typescript_internal_1.PURCHASE_TYPE.SUBS; }
|
|
379
426
|
return __generator(this, function (_a) {
|
|
380
427
|
switch (_a.label) {
|
|
381
|
-
case 0: return [4 /*yield*/,
|
|
428
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
382
429
|
case 1:
|
|
383
430
|
_a.sent();
|
|
384
431
|
return [2 /*return*/, RNPurchases.purchaseProduct(productIdentifier, upgradeInfo, type, null, null, null).catch(function (error) {
|
|
@@ -408,7 +455,7 @@ var Purchases = /** @class */ (function () {
|
|
|
408
455
|
return __awaiter(this, void 0, void 0, function () {
|
|
409
456
|
return __generator(this, function (_a) {
|
|
410
457
|
switch (_a.label) {
|
|
411
|
-
case 0: return [4 /*yield*/,
|
|
458
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
412
459
|
case 1:
|
|
413
460
|
_a.sent();
|
|
414
461
|
return [2 /*return*/, RNPurchases.purchaseProduct(product.identifier, productChangeInfo, product.productCategory, null, googleIsPersonalizedPrice == null
|
|
@@ -439,7 +486,7 @@ var Purchases = /** @class */ (function () {
|
|
|
439
486
|
return __awaiter(this, void 0, void 0, function () {
|
|
440
487
|
return __generator(this, function (_a) {
|
|
441
488
|
switch (_a.label) {
|
|
442
|
-
case 0: return [4 /*yield*/,
|
|
489
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
443
490
|
case 1:
|
|
444
491
|
_a.sent();
|
|
445
492
|
if (typeof discount === "undefined" || discount == null) {
|
|
@@ -473,7 +520,7 @@ var Purchases = /** @class */ (function () {
|
|
|
473
520
|
return __awaiter(this, void 0, void 0, function () {
|
|
474
521
|
return __generator(this, function (_a) {
|
|
475
522
|
switch (_a.label) {
|
|
476
|
-
case 0: return [4 /*yield*/,
|
|
523
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
477
524
|
case 1:
|
|
478
525
|
_a.sent();
|
|
479
526
|
return [2 /*return*/, RNPurchases.purchasePackage(aPackage.identifier, aPackage.presentedOfferingContext, productChangeInfo || upgradeInfo, null, googleIsPersonalizedPrice == null
|
|
@@ -505,7 +552,7 @@ var Purchases = /** @class */ (function () {
|
|
|
505
552
|
return __awaiter(this, void 0, void 0, function () {
|
|
506
553
|
return __generator(this, function (_a) {
|
|
507
554
|
switch (_a.label) {
|
|
508
|
-
case 0: return [4 /*yield*/,
|
|
555
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
509
556
|
case 1:
|
|
510
557
|
_a.sent();
|
|
511
558
|
return [4 /*yield*/, Purchases.throwIfIOSPlatform()];
|
|
@@ -536,7 +583,7 @@ var Purchases = /** @class */ (function () {
|
|
|
536
583
|
return __awaiter(this, void 0, void 0, function () {
|
|
537
584
|
return __generator(this, function (_a) {
|
|
538
585
|
switch (_a.label) {
|
|
539
|
-
case 0: return [4 /*yield*/,
|
|
586
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
540
587
|
case 1:
|
|
541
588
|
_a.sent();
|
|
542
589
|
if (typeof discount === "undefined" || discount == null) {
|
|
@@ -560,7 +607,7 @@ var Purchases = /** @class */ (function () {
|
|
|
560
607
|
return __awaiter(this, void 0, void 0, function () {
|
|
561
608
|
return __generator(this, function (_a) {
|
|
562
609
|
switch (_a.label) {
|
|
563
|
-
case 0: return [4 /*yield*/,
|
|
610
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
564
611
|
case 1:
|
|
565
612
|
_a.sent();
|
|
566
613
|
return [2 /*return*/, RNPurchases.restorePurchases()];
|
|
@@ -576,7 +623,7 @@ var Purchases = /** @class */ (function () {
|
|
|
576
623
|
return __awaiter(this, void 0, void 0, function () {
|
|
577
624
|
return __generator(this, function (_a) {
|
|
578
625
|
switch (_a.label) {
|
|
579
|
-
case 0: return [4 /*yield*/,
|
|
626
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
580
627
|
case 1:
|
|
581
628
|
_a.sent();
|
|
582
629
|
return [2 /*return*/, RNPurchases.getAppUserID()];
|
|
@@ -592,7 +639,7 @@ var Purchases = /** @class */ (function () {
|
|
|
592
639
|
return __awaiter(this, void 0, void 0, function () {
|
|
593
640
|
return __generator(this, function (_a) {
|
|
594
641
|
switch (_a.label) {
|
|
595
|
-
case 0: return [4 /*yield*/,
|
|
642
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
596
643
|
case 1:
|
|
597
644
|
_a.sent();
|
|
598
645
|
return [2 /*return*/, RNPurchases.getStorefront()];
|
|
@@ -612,7 +659,7 @@ var Purchases = /** @class */ (function () {
|
|
|
612
659
|
return __awaiter(this, void 0, void 0, function () {
|
|
613
660
|
return __generator(this, function (_a) {
|
|
614
661
|
switch (_a.label) {
|
|
615
|
-
case 0: return [4 /*yield*/,
|
|
662
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
616
663
|
case 1:
|
|
617
664
|
_a.sent();
|
|
618
665
|
// noinspection SuspiciousTypeOfGuard
|
|
@@ -634,7 +681,7 @@ var Purchases = /** @class */ (function () {
|
|
|
634
681
|
return __awaiter(this, void 0, void 0, function () {
|
|
635
682
|
return __generator(this, function (_a) {
|
|
636
683
|
switch (_a.label) {
|
|
637
|
-
case 0: return [4 /*yield*/,
|
|
684
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
638
685
|
case 1:
|
|
639
686
|
_a.sent();
|
|
640
687
|
return [2 /*return*/, RNPurchases.logOut()];
|
|
@@ -696,7 +743,7 @@ var Purchases = /** @class */ (function () {
|
|
|
696
743
|
var isFirstListener;
|
|
697
744
|
return __generator(this, function (_a) {
|
|
698
745
|
switch (_a.label) {
|
|
699
|
-
case 0: return [4 /*yield*/,
|
|
746
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
700
747
|
case 1:
|
|
701
748
|
_a.sent();
|
|
702
749
|
if (react_native_2.Platform.OS === "android" || react_native_2.Platform.OS === "ios") {
|
|
@@ -735,7 +782,7 @@ var Purchases = /** @class */ (function () {
|
|
|
735
782
|
var isFirstListener;
|
|
736
783
|
return __generator(this, function (_a) {
|
|
737
784
|
switch (_a.label) {
|
|
738
|
-
case 0: return [4 /*yield*/,
|
|
785
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
739
786
|
case 1:
|
|
740
787
|
_a.sent();
|
|
741
788
|
if (react_native_2.Platform.OS === "android") {
|
|
@@ -772,7 +819,7 @@ var Purchases = /** @class */ (function () {
|
|
|
772
819
|
return __awaiter(this, void 0, void 0, function () {
|
|
773
820
|
return __generator(this, function (_a) {
|
|
774
821
|
switch (_a.label) {
|
|
775
|
-
case 0: return [4 /*yield*/,
|
|
822
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
776
823
|
case 1:
|
|
777
824
|
_a.sent();
|
|
778
825
|
return [2 /*return*/, RNPurchases.getCustomerInfo()];
|
|
@@ -793,7 +840,7 @@ var Purchases = /** @class */ (function () {
|
|
|
793
840
|
return __awaiter(this, void 0, void 0, function () {
|
|
794
841
|
return __generator(this, function (_a) {
|
|
795
842
|
switch (_a.label) {
|
|
796
|
-
case 0: return [4 /*yield*/,
|
|
843
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
797
844
|
case 1:
|
|
798
845
|
_a.sent();
|
|
799
846
|
RNPurchases.syncPurchases();
|
|
@@ -815,7 +862,7 @@ var Purchases = /** @class */ (function () {
|
|
|
815
862
|
var customerInfo;
|
|
816
863
|
return __generator(this, function (_a) {
|
|
817
864
|
switch (_a.label) {
|
|
818
|
-
case 0: return [4 /*yield*/,
|
|
865
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
819
866
|
case 1:
|
|
820
867
|
_a.sent();
|
|
821
868
|
return [4 /*yield*/, RNPurchases.syncPurchasesForResult()];
|
|
@@ -847,7 +894,7 @@ var Purchases = /** @class */ (function () {
|
|
|
847
894
|
case 0: return [4 /*yield*/, Purchases.throwIfIOSPlatform()];
|
|
848
895
|
case 1:
|
|
849
896
|
_a.sent();
|
|
850
|
-
return [4 /*yield*/,
|
|
897
|
+
return [4 /*yield*/, throwIfNotConfigured()];
|
|
851
898
|
case 2:
|
|
852
899
|
_a.sent();
|
|
853
900
|
RNPurchases.syncAmazonPurchase(productID, receiptID, amazonUserID, isoCurrencyCode, price);
|
|
@@ -879,7 +926,7 @@ var Purchases = /** @class */ (function () {
|
|
|
879
926
|
case 0: return [4 /*yield*/, Purchases.throwIfIOSPlatform()];
|
|
880
927
|
case 1:
|
|
881
928
|
_a.sent();
|
|
882
|
-
return [4 /*yield*/,
|
|
929
|
+
return [4 /*yield*/, throwIfNotConfigured()];
|
|
883
930
|
case 2:
|
|
884
931
|
_a.sent();
|
|
885
932
|
RNPurchases.syncObserverModeAmazonPurchase(productID, receiptID, amazonUserID, isoCurrencyCode, price);
|
|
@@ -910,7 +957,7 @@ var Purchases = /** @class */ (function () {
|
|
|
910
957
|
case 0: return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
911
958
|
case 1:
|
|
912
959
|
_a.sent();
|
|
913
|
-
return [4 /*yield*/,
|
|
960
|
+
return [4 /*yield*/, throwIfNotConfigured()];
|
|
914
961
|
case 2:
|
|
915
962
|
_a.sent();
|
|
916
963
|
return [2 /*return*/, RNPurchases.recordPurchaseForProductID(productID)];
|
|
@@ -928,7 +975,7 @@ var Purchases = /** @class */ (function () {
|
|
|
928
975
|
switch (_a.label) {
|
|
929
976
|
case 0:
|
|
930
977
|
if (!(react_native_2.Platform.OS === "ios")) return [3 /*break*/, 2];
|
|
931
|
-
return [4 /*yield*/,
|
|
978
|
+
return [4 /*yield*/, throwIfNotConfigured()];
|
|
932
979
|
case 1:
|
|
933
980
|
_a.sent();
|
|
934
981
|
RNPurchases.enableAdServicesAttributionTokenCollection();
|
|
@@ -946,7 +993,7 @@ var Purchases = /** @class */ (function () {
|
|
|
946
993
|
return __awaiter(this, void 0, void 0, function () {
|
|
947
994
|
return __generator(this, function (_a) {
|
|
948
995
|
switch (_a.label) {
|
|
949
|
-
case 0: return [4 /*yield*/,
|
|
996
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
950
997
|
case 1:
|
|
951
998
|
_a.sent();
|
|
952
999
|
return [2 /*return*/, RNPurchases.isAnonymous()];
|
|
@@ -973,7 +1020,7 @@ var Purchases = /** @class */ (function () {
|
|
|
973
1020
|
return __awaiter(this, void 0, void 0, function () {
|
|
974
1021
|
return __generator(this, function (_a) {
|
|
975
1022
|
switch (_a.label) {
|
|
976
|
-
case 0: return [4 /*yield*/,
|
|
1023
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
977
1024
|
case 1:
|
|
978
1025
|
_a.sent();
|
|
979
1026
|
return [2 /*return*/, RNPurchases.checkTrialOrIntroductoryPriceEligibility(productIdentifiers)];
|
|
@@ -994,7 +1041,7 @@ var Purchases = /** @class */ (function () {
|
|
|
994
1041
|
return __awaiter(this, void 0, void 0, function () {
|
|
995
1042
|
return __generator(this, function (_a) {
|
|
996
1043
|
switch (_a.label) {
|
|
997
|
-
case 0: return [4 /*yield*/,
|
|
1044
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
998
1045
|
case 1:
|
|
999
1046
|
_a.sent();
|
|
1000
1047
|
if (react_native_2.Platform.OS === "android") {
|
|
@@ -1021,7 +1068,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1021
1068
|
return __awaiter(this, void 0, void 0, function () {
|
|
1022
1069
|
return __generator(this, function (_a) {
|
|
1023
1070
|
switch (_a.label) {
|
|
1024
|
-
case 0: return [4 /*yield*/,
|
|
1071
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1025
1072
|
case 1:
|
|
1026
1073
|
_a.sent();
|
|
1027
1074
|
if (react_native_2.Platform.OS === "android") {
|
|
@@ -1045,7 +1092,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1045
1092
|
return __awaiter(this, void 0, void 0, function () {
|
|
1046
1093
|
return __generator(this, function (_a) {
|
|
1047
1094
|
switch (_a.label) {
|
|
1048
|
-
case 0: return [4 /*yield*/,
|
|
1095
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1049
1096
|
case 1:
|
|
1050
1097
|
_a.sent();
|
|
1051
1098
|
if (react_native_2.Platform.OS === "android") {
|
|
@@ -1072,7 +1119,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1072
1119
|
return __awaiter(this, void 0, void 0, function () {
|
|
1073
1120
|
return __generator(this, function (_a) {
|
|
1074
1121
|
switch (_a.label) {
|
|
1075
|
-
case 0: return [4 /*yield*/,
|
|
1122
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1076
1123
|
case 1:
|
|
1077
1124
|
_a.sent();
|
|
1078
1125
|
if (typeof winBackOffer === "undefined" || winBackOffer == null) {
|
|
@@ -1106,7 +1153,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1106
1153
|
return __awaiter(this, void 0, void 0, function () {
|
|
1107
1154
|
return __generator(this, function (_a) {
|
|
1108
1155
|
switch (_a.label) {
|
|
1109
|
-
case 0: return [4 /*yield*/,
|
|
1156
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1110
1157
|
case 1:
|
|
1111
1158
|
_a.sent();
|
|
1112
1159
|
if (typeof winBackOffer === "undefined" || winBackOffer == null) {
|
|
@@ -1140,7 +1187,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1140
1187
|
return __awaiter(this, void 0, void 0, function () {
|
|
1141
1188
|
return __generator(this, function (_a) {
|
|
1142
1189
|
switch (_a.label) {
|
|
1143
|
-
case 0: return [4 /*yield*/,
|
|
1190
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1144
1191
|
case 1:
|
|
1145
1192
|
_a.sent();
|
|
1146
1193
|
RNPurchases.invalidateCustomerInfoCache();
|
|
@@ -1161,7 +1208,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1161
1208
|
switch (_a.label) {
|
|
1162
1209
|
case 0:
|
|
1163
1210
|
if (!(react_native_2.Platform.OS === "ios")) return [3 /*break*/, 2];
|
|
1164
|
-
return [4 /*yield*/,
|
|
1211
|
+
return [4 /*yield*/, throwIfNotConfigured()];
|
|
1165
1212
|
case 1:
|
|
1166
1213
|
_a.sent();
|
|
1167
1214
|
RNPurchases.presentCodeRedemptionSheet();
|
|
@@ -1187,7 +1234,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1187
1234
|
return __awaiter(this, void 0, void 0, function () {
|
|
1188
1235
|
return __generator(this, function (_a) {
|
|
1189
1236
|
switch (_a.label) {
|
|
1190
|
-
case 0: return [4 /*yield*/,
|
|
1237
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1191
1238
|
case 1:
|
|
1192
1239
|
_a.sent();
|
|
1193
1240
|
RNPurchases.setAttributes(attributes);
|
|
@@ -1207,7 +1254,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1207
1254
|
return __awaiter(this, void 0, void 0, function () {
|
|
1208
1255
|
return __generator(this, function (_a) {
|
|
1209
1256
|
switch (_a.label) {
|
|
1210
|
-
case 0: return [4 /*yield*/,
|
|
1257
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1211
1258
|
case 1:
|
|
1212
1259
|
_a.sent();
|
|
1213
1260
|
RNPurchases.setEmail(email);
|
|
@@ -1227,7 +1274,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1227
1274
|
return __awaiter(this, void 0, void 0, function () {
|
|
1228
1275
|
return __generator(this, function (_a) {
|
|
1229
1276
|
switch (_a.label) {
|
|
1230
|
-
case 0: return [4 /*yield*/,
|
|
1277
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1231
1278
|
case 1:
|
|
1232
1279
|
_a.sent();
|
|
1233
1280
|
RNPurchases.setPhoneNumber(phoneNumber);
|
|
@@ -1247,7 +1294,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1247
1294
|
return __awaiter(this, void 0, void 0, function () {
|
|
1248
1295
|
return __generator(this, function (_a) {
|
|
1249
1296
|
switch (_a.label) {
|
|
1250
|
-
case 0: return [4 /*yield*/,
|
|
1297
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1251
1298
|
case 1:
|
|
1252
1299
|
_a.sent();
|
|
1253
1300
|
RNPurchases.setDisplayName(displayName);
|
|
@@ -1267,7 +1314,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1267
1314
|
return __awaiter(this, void 0, void 0, function () {
|
|
1268
1315
|
return __generator(this, function (_a) {
|
|
1269
1316
|
switch (_a.label) {
|
|
1270
|
-
case 0: return [4 /*yield*/,
|
|
1317
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1271
1318
|
case 1:
|
|
1272
1319
|
_a.sent();
|
|
1273
1320
|
RNPurchases.setPushToken(pushToken);
|
|
@@ -1299,7 +1346,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1299
1346
|
return __awaiter(this, void 0, void 0, function () {
|
|
1300
1347
|
return __generator(this, function (_a) {
|
|
1301
1348
|
switch (_a.label) {
|
|
1302
|
-
case 0: return [4 /*yield*/,
|
|
1349
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1303
1350
|
case 1:
|
|
1304
1351
|
_a.sent();
|
|
1305
1352
|
RNPurchases.collectDeviceIdentifiers();
|
|
@@ -1320,7 +1367,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1320
1367
|
return __awaiter(this, void 0, void 0, function () {
|
|
1321
1368
|
return __generator(this, function (_a) {
|
|
1322
1369
|
switch (_a.label) {
|
|
1323
|
-
case 0: return [4 /*yield*/,
|
|
1370
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1324
1371
|
case 1:
|
|
1325
1372
|
_a.sent();
|
|
1326
1373
|
RNPurchases.setAdjustID(adjustID);
|
|
@@ -1340,7 +1387,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1340
1387
|
return __awaiter(this, void 0, void 0, function () {
|
|
1341
1388
|
return __generator(this, function (_a) {
|
|
1342
1389
|
switch (_a.label) {
|
|
1343
|
-
case 0: return [4 /*yield*/,
|
|
1390
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1344
1391
|
case 1:
|
|
1345
1392
|
_a.sent();
|
|
1346
1393
|
RNPurchases.setAppsflyerID(appsflyerID);
|
|
@@ -1361,7 +1408,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1361
1408
|
return __awaiter(this, void 0, void 0, function () {
|
|
1362
1409
|
return __generator(this, function (_a) {
|
|
1363
1410
|
switch (_a.label) {
|
|
1364
|
-
case 0: return [4 /*yield*/,
|
|
1411
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1365
1412
|
case 1:
|
|
1366
1413
|
_a.sent();
|
|
1367
1414
|
RNPurchases.setFBAnonymousID(fbAnonymousID);
|
|
@@ -1382,7 +1429,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1382
1429
|
return __awaiter(this, void 0, void 0, function () {
|
|
1383
1430
|
return __generator(this, function (_a) {
|
|
1384
1431
|
switch (_a.label) {
|
|
1385
|
-
case 0: return [4 /*yield*/,
|
|
1432
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1386
1433
|
case 1:
|
|
1387
1434
|
_a.sent();
|
|
1388
1435
|
RNPurchases.setMparticleID(mparticleID);
|
|
@@ -1403,7 +1450,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1403
1450
|
return __awaiter(this, void 0, void 0, function () {
|
|
1404
1451
|
return __generator(this, function (_a) {
|
|
1405
1452
|
switch (_a.label) {
|
|
1406
|
-
case 0: return [4 /*yield*/,
|
|
1453
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1407
1454
|
case 1:
|
|
1408
1455
|
_a.sent();
|
|
1409
1456
|
RNPurchases.setCleverTapID(cleverTapID);
|
|
@@ -1424,7 +1471,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1424
1471
|
return __awaiter(this, void 0, void 0, function () {
|
|
1425
1472
|
return __generator(this, function (_a) {
|
|
1426
1473
|
switch (_a.label) {
|
|
1427
|
-
case 0: return [4 /*yield*/,
|
|
1474
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1428
1475
|
case 1:
|
|
1429
1476
|
_a.sent();
|
|
1430
1477
|
RNPurchases.setMixpanelDistinctID(mixpanelDistinctID);
|
|
@@ -1445,7 +1492,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1445
1492
|
return __awaiter(this, void 0, void 0, function () {
|
|
1446
1493
|
return __generator(this, function (_a) {
|
|
1447
1494
|
switch (_a.label) {
|
|
1448
|
-
case 0: return [4 /*yield*/,
|
|
1495
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1449
1496
|
case 1:
|
|
1450
1497
|
_a.sent();
|
|
1451
1498
|
RNPurchases.setFirebaseAppInstanceID(firebaseAppInstanceID);
|
|
@@ -1466,7 +1513,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1466
1513
|
return __awaiter(this, void 0, void 0, function () {
|
|
1467
1514
|
return __generator(this, function (_a) {
|
|
1468
1515
|
switch (_a.label) {
|
|
1469
|
-
case 0: return [4 /*yield*/,
|
|
1516
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1470
1517
|
case 1:
|
|
1471
1518
|
_a.sent();
|
|
1472
1519
|
RNPurchases.setTenjinAnalyticsInstallationID(tenjinAnalyticsInstallationID);
|
|
@@ -1487,7 +1534,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1487
1534
|
return __awaiter(this, void 0, void 0, function () {
|
|
1488
1535
|
return __generator(this, function (_a) {
|
|
1489
1536
|
switch (_a.label) {
|
|
1490
|
-
case 0: return [4 /*yield*/,
|
|
1537
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1491
1538
|
case 1:
|
|
1492
1539
|
_a.sent();
|
|
1493
1540
|
RNPurchases.setKochavaDeviceID(kochavaDeviceID);
|
|
@@ -1508,7 +1555,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1508
1555
|
return __awaiter(this, void 0, void 0, function () {
|
|
1509
1556
|
return __generator(this, function (_a) {
|
|
1510
1557
|
switch (_a.label) {
|
|
1511
|
-
case 0: return [4 /*yield*/,
|
|
1558
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1512
1559
|
case 1:
|
|
1513
1560
|
_a.sent();
|
|
1514
1561
|
RNPurchases.setOnesignalID(onesignalID);
|
|
@@ -1529,7 +1576,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1529
1576
|
return __awaiter(this, void 0, void 0, function () {
|
|
1530
1577
|
return __generator(this, function (_a) {
|
|
1531
1578
|
switch (_a.label) {
|
|
1532
|
-
case 0: return [4 /*yield*/,
|
|
1579
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1533
1580
|
case 1:
|
|
1534
1581
|
_a.sent();
|
|
1535
1582
|
RNPurchases.setAirshipChannelID(airshipChannelID);
|
|
@@ -1549,7 +1596,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1549
1596
|
return __awaiter(this, void 0, void 0, function () {
|
|
1550
1597
|
return __generator(this, function (_a) {
|
|
1551
1598
|
switch (_a.label) {
|
|
1552
|
-
case 0: return [4 /*yield*/,
|
|
1599
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1553
1600
|
case 1:
|
|
1554
1601
|
_a.sent();
|
|
1555
1602
|
RNPurchases.setMediaSource(mediaSource);
|
|
@@ -1569,7 +1616,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1569
1616
|
return __awaiter(this, void 0, void 0, function () {
|
|
1570
1617
|
return __generator(this, function (_a) {
|
|
1571
1618
|
switch (_a.label) {
|
|
1572
|
-
case 0: return [4 /*yield*/,
|
|
1619
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1573
1620
|
case 1:
|
|
1574
1621
|
_a.sent();
|
|
1575
1622
|
RNPurchases.setCampaign(campaign);
|
|
@@ -1589,7 +1636,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1589
1636
|
return __awaiter(this, void 0, void 0, function () {
|
|
1590
1637
|
return __generator(this, function (_a) {
|
|
1591
1638
|
switch (_a.label) {
|
|
1592
|
-
case 0: return [4 /*yield*/,
|
|
1639
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1593
1640
|
case 1:
|
|
1594
1641
|
_a.sent();
|
|
1595
1642
|
RNPurchases.setAdGroup(adGroup);
|
|
@@ -1609,7 +1656,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1609
1656
|
return __awaiter(this, void 0, void 0, function () {
|
|
1610
1657
|
return __generator(this, function (_a) {
|
|
1611
1658
|
switch (_a.label) {
|
|
1612
|
-
case 0: return [4 /*yield*/,
|
|
1659
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1613
1660
|
case 1:
|
|
1614
1661
|
_a.sent();
|
|
1615
1662
|
RNPurchases.setAd(ad);
|
|
@@ -1629,7 +1676,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1629
1676
|
return __awaiter(this, void 0, void 0, function () {
|
|
1630
1677
|
return __generator(this, function (_a) {
|
|
1631
1678
|
switch (_a.label) {
|
|
1632
|
-
case 0: return [4 /*yield*/,
|
|
1679
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1633
1680
|
case 1:
|
|
1634
1681
|
_a.sent();
|
|
1635
1682
|
RNPurchases.setKeyword(keyword);
|
|
@@ -1649,7 +1696,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1649
1696
|
return __awaiter(this, void 0, void 0, function () {
|
|
1650
1697
|
return __generator(this, function (_a) {
|
|
1651
1698
|
switch (_a.label) {
|
|
1652
|
-
case 0: return [4 /*yield*/,
|
|
1699
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1653
1700
|
case 1:
|
|
1654
1701
|
_a.sent();
|
|
1655
1702
|
RNPurchases.setCreative(creative);
|
|
@@ -1669,7 +1716,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1669
1716
|
return __awaiter(this, void 0, void 0, function () {
|
|
1670
1717
|
return __generator(this, function (_a) {
|
|
1671
1718
|
switch (_a.label) {
|
|
1672
|
-
case 0: return [4 /*yield*/,
|
|
1719
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1673
1720
|
case 1:
|
|
1674
1721
|
_a.sent();
|
|
1675
1722
|
RNPurchases.overridePreferredLocale(locale);
|
|
@@ -1717,7 +1764,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1717
1764
|
var refundRequestStatusInt;
|
|
1718
1765
|
return __generator(this, function (_a) {
|
|
1719
1766
|
switch (_a.label) {
|
|
1720
|
-
case 0: return [4 /*yield*/,
|
|
1767
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1721
1768
|
case 1:
|
|
1722
1769
|
_a.sent();
|
|
1723
1770
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
@@ -1750,7 +1797,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1750
1797
|
var refundRequestStatusInt;
|
|
1751
1798
|
return __generator(this, function (_a) {
|
|
1752
1799
|
switch (_a.label) {
|
|
1753
|
-
case 0: return [4 /*yield*/,
|
|
1800
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1754
1801
|
case 1:
|
|
1755
1802
|
_a.sent();
|
|
1756
1803
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
@@ -1783,7 +1830,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1783
1830
|
var refundRequestStatusInt;
|
|
1784
1831
|
return __generator(this, function (_a) {
|
|
1785
1832
|
switch (_a.label) {
|
|
1786
|
-
case 0: return [4 /*yield*/,
|
|
1833
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1787
1834
|
case 1:
|
|
1788
1835
|
_a.sent();
|
|
1789
1836
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
@@ -1807,7 +1854,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1807
1854
|
return __awaiter(this, void 0, void 0, function () {
|
|
1808
1855
|
return __generator(this, function (_a) {
|
|
1809
1856
|
switch (_a.label) {
|
|
1810
|
-
case 0: return [4 /*yield*/,
|
|
1857
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1811
1858
|
case 1:
|
|
1812
1859
|
_a.sent();
|
|
1813
1860
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
@@ -1833,7 +1880,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1833
1880
|
return __awaiter(this, void 0, void 0, function () {
|
|
1834
1881
|
return __generator(this, function (_a) {
|
|
1835
1882
|
switch (_a.label) {
|
|
1836
|
-
case 0: return [4 /*yield*/,
|
|
1883
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1837
1884
|
case 1:
|
|
1838
1885
|
_a.sent();
|
|
1839
1886
|
return [2 /*return*/, RNPurchases.showInAppMessages(messageTypes)];
|
|
@@ -1870,7 +1917,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1870
1917
|
return __awaiter(this, void 0, void 0, function () {
|
|
1871
1918
|
return __generator(this, function (_a) {
|
|
1872
1919
|
switch (_a.label) {
|
|
1873
|
-
case 0: return [4 /*yield*/,
|
|
1920
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1874
1921
|
case 1:
|
|
1875
1922
|
_a.sent();
|
|
1876
1923
|
return [2 /*return*/, RNPurchases.redeemWebPurchase(webPurchaseRedemption.redemptionLink)];
|
|
@@ -1888,7 +1935,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1888
1935
|
return __awaiter(this, void 0, void 0, function () {
|
|
1889
1936
|
return __generator(this, function (_a) {
|
|
1890
1937
|
switch (_a.label) {
|
|
1891
|
-
case 0: return [4 /*yield*/,
|
|
1938
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1892
1939
|
case 1:
|
|
1893
1940
|
_a.sent();
|
|
1894
1941
|
return [2 /*return*/, RNPurchases.getVirtualCurrencies()];
|
|
@@ -1910,7 +1957,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1910
1957
|
return __awaiter(this, void 0, void 0, function () {
|
|
1911
1958
|
return __generator(this, function (_a) {
|
|
1912
1959
|
switch (_a.label) {
|
|
1913
|
-
case 0: return [4 /*yield*/,
|
|
1960
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1914
1961
|
case 1:
|
|
1915
1962
|
_a.sent();
|
|
1916
1963
|
RNPurchases.invalidateVirtualCurrenciesCache();
|
|
@@ -1932,7 +1979,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1932
1979
|
var result;
|
|
1933
1980
|
return __generator(this, function (_a) {
|
|
1934
1981
|
switch (_a.label) {
|
|
1935
|
-
case 0: return [4 /*yield*/,
|
|
1982
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1936
1983
|
case 1:
|
|
1937
1984
|
_a.sent();
|
|
1938
1985
|
return [4 /*yield*/, RNPurchases.getCachedVirtualCurrencies()];
|
|
@@ -1957,6 +2004,20 @@ var Purchases = /** @class */ (function () {
|
|
|
1957
2004
|
}
|
|
1958
2005
|
return RNPurchases.isConfigured();
|
|
1959
2006
|
};
|
|
2007
|
+
Object.defineProperty(Purchases, "adTracker", {
|
|
2008
|
+
/**
|
|
2009
|
+
* Provides access to ad lifecycle tracking methods.
|
|
2010
|
+
* @beta
|
|
2011
|
+
*/
|
|
2012
|
+
get: function () {
|
|
2013
|
+
if (!adTrackerSingleton) {
|
|
2014
|
+
adTrackerSingleton = new PurchasesAdTracker();
|
|
2015
|
+
}
|
|
2016
|
+
return adTrackerSingleton;
|
|
2017
|
+
},
|
|
2018
|
+
enumerable: false,
|
|
2019
|
+
configurable: true
|
|
2020
|
+
});
|
|
1960
2021
|
/**
|
|
1961
2022
|
* Tracks an impression of a custom (non-RevenueCat) paywall.
|
|
1962
2023
|
* Call this method when your custom paywall is displayed to a user.
|
|
@@ -1971,7 +2032,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1971
2032
|
return __awaiter(this, void 0, void 0, function () {
|
|
1972
2033
|
return __generator(this, function (_a) {
|
|
1973
2034
|
switch (_a.label) {
|
|
1974
|
-
case 0: return [4 /*yield*/,
|
|
2035
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1975
2036
|
case 1:
|
|
1976
2037
|
_a.sent();
|
|
1977
2038
|
RNPurchases.trackCustomPaywallImpression(params !== null && params !== void 0 ? params : {});
|
|
@@ -1980,22 +2041,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1980
2041
|
});
|
|
1981
2042
|
});
|
|
1982
2043
|
};
|
|
1983
|
-
Purchases.throwIfNotConfigured = function () {
|
|
1984
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1985
|
-
var isConfigured;
|
|
1986
|
-
return __generator(this, function (_a) {
|
|
1987
|
-
switch (_a.label) {
|
|
1988
|
-
case 0: return [4 /*yield*/, Purchases.isConfigured()];
|
|
1989
|
-
case 1:
|
|
1990
|
-
isConfigured = _a.sent();
|
|
1991
|
-
if (!isConfigured) {
|
|
1992
|
-
throw new purchases_typescript_internal_1.UninitializedPurchasesError();
|
|
1993
|
-
}
|
|
1994
|
-
return [2 /*return*/];
|
|
1995
|
-
}
|
|
1996
|
-
});
|
|
1997
|
-
});
|
|
1998
|
-
};
|
|
1999
2044
|
Purchases.throwIfAndroidPlatform = function () {
|
|
2000
2045
|
return __awaiter(this, void 0, void 0, function () {
|
|
2001
2046
|
return __generator(this, function (_a) {
|
|
@@ -2131,3 +2176,80 @@ var Purchases = /** @class */ (function () {
|
|
|
2131
2176
|
return Purchases;
|
|
2132
2177
|
}());
|
|
2133
2178
|
exports.default = Purchases;
|
|
2179
|
+
var adTrackerSingleton;
|
|
2180
|
+
/**
|
|
2181
|
+
* Provides methods for tracking ad lifecycle events.
|
|
2182
|
+
* Access via {@link Purchases.adTracker}.
|
|
2183
|
+
* @beta
|
|
2184
|
+
*/
|
|
2185
|
+
var PurchasesAdTracker = /** @class */ (function () {
|
|
2186
|
+
function PurchasesAdTracker() {
|
|
2187
|
+
}
|
|
2188
|
+
PurchasesAdTracker.prototype.trackAdDisplayed = function (data) {
|
|
2189
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2190
|
+
return __generator(this, function (_a) {
|
|
2191
|
+
switch (_a.label) {
|
|
2192
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
2193
|
+
case 1:
|
|
2194
|
+
_a.sent();
|
|
2195
|
+
RNPurchases.trackAdDisplayed(data);
|
|
2196
|
+
return [2 /*return*/];
|
|
2197
|
+
}
|
|
2198
|
+
});
|
|
2199
|
+
});
|
|
2200
|
+
};
|
|
2201
|
+
PurchasesAdTracker.prototype.trackAdOpened = function (data) {
|
|
2202
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2203
|
+
return __generator(this, function (_a) {
|
|
2204
|
+
switch (_a.label) {
|
|
2205
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
2206
|
+
case 1:
|
|
2207
|
+
_a.sent();
|
|
2208
|
+
RNPurchases.trackAdOpened(data);
|
|
2209
|
+
return [2 /*return*/];
|
|
2210
|
+
}
|
|
2211
|
+
});
|
|
2212
|
+
});
|
|
2213
|
+
};
|
|
2214
|
+
PurchasesAdTracker.prototype.trackAdLoaded = function (data) {
|
|
2215
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2216
|
+
return __generator(this, function (_a) {
|
|
2217
|
+
switch (_a.label) {
|
|
2218
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
2219
|
+
case 1:
|
|
2220
|
+
_a.sent();
|
|
2221
|
+
RNPurchases.trackAdLoaded(data);
|
|
2222
|
+
return [2 /*return*/];
|
|
2223
|
+
}
|
|
2224
|
+
});
|
|
2225
|
+
});
|
|
2226
|
+
};
|
|
2227
|
+
PurchasesAdTracker.prototype.trackAdRevenue = function (data) {
|
|
2228
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2229
|
+
return __generator(this, function (_a) {
|
|
2230
|
+
switch (_a.label) {
|
|
2231
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
2232
|
+
case 1:
|
|
2233
|
+
_a.sent();
|
|
2234
|
+
RNPurchases.trackAdRevenue(data);
|
|
2235
|
+
return [2 /*return*/];
|
|
2236
|
+
}
|
|
2237
|
+
});
|
|
2238
|
+
});
|
|
2239
|
+
};
|
|
2240
|
+
PurchasesAdTracker.prototype.trackAdFailedToLoad = function (data) {
|
|
2241
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2242
|
+
return __generator(this, function (_a) {
|
|
2243
|
+
switch (_a.label) {
|
|
2244
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
2245
|
+
case 1:
|
|
2246
|
+
_a.sent();
|
|
2247
|
+
RNPurchases.trackAdFailedToLoad(data);
|
|
2248
|
+
return [2 /*return*/];
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
});
|
|
2252
|
+
};
|
|
2253
|
+
return PurchasesAdTracker;
|
|
2254
|
+
}());
|
|
2255
|
+
exports.PurchasesAdTracker = PurchasesAdTracker;
|
package/ios/RNPurchases.m
CHANGED
|
@@ -635,6 +635,46 @@ RCT_EXPORT_METHOD(trackCustomPaywallImpression:(NSDictionary *)data) {
|
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
|
|
638
|
+
RCT_EXPORT_METHOD(trackAdDisplayed:(NSDictionary *)data) {
|
|
639
|
+
if (@available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *)) {
|
|
640
|
+
[RCCommonFunctionality trackAdDisplayed:data];
|
|
641
|
+
} else {
|
|
642
|
+
NSLog(@"[Purchases] Warning: tried to call trackAdDisplayed, but it's only available on iOS 15.0 or greater.");
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
RCT_EXPORT_METHOD(trackAdOpened:(NSDictionary *)data) {
|
|
647
|
+
if (@available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *)) {
|
|
648
|
+
[RCCommonFunctionality trackAdOpened:data];
|
|
649
|
+
} else {
|
|
650
|
+
NSLog(@"[Purchases] Warning: tried to call trackAdOpened, but it's only available on iOS 15.0 or greater.");
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
RCT_EXPORT_METHOD(trackAdLoaded:(NSDictionary *)data) {
|
|
655
|
+
if (@available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *)) {
|
|
656
|
+
[RCCommonFunctionality trackAdLoaded:data];
|
|
657
|
+
} else {
|
|
658
|
+
NSLog(@"[Purchases] Warning: tried to call trackAdLoaded, but it's only available on iOS 15.0 or greater.");
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
RCT_EXPORT_METHOD(trackAdRevenue:(NSDictionary *)data) {
|
|
663
|
+
if (@available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *)) {
|
|
664
|
+
[RCCommonFunctionality trackAdRevenue:data];
|
|
665
|
+
} else {
|
|
666
|
+
NSLog(@"[Purchases] Warning: tried to call trackAdRevenue, but it's only available on iOS 15.0 or greater.");
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
RCT_EXPORT_METHOD(trackAdFailedToLoad:(NSDictionary *)data) {
|
|
671
|
+
if (@available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *)) {
|
|
672
|
+
[RCCommonFunctionality trackAdFailedToLoad:data];
|
|
673
|
+
} else {
|
|
674
|
+
NSLog(@"[Purchases] Warning: tried to call trackAdFailedToLoad, but it's only available on iOS 15.0 or greater.");
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
638
678
|
#pragma mark -
|
|
639
679
|
#pragma mark Delegate Methods
|
|
640
680
|
- (void)purchases:(RCPurchases *)purchases receivedUpdatedCustomerInfo:(RCCustomerInfo *)customerInfo {
|
|
@@ -697,7 +737,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
|
|
|
697
737
|
}
|
|
698
738
|
|
|
699
739
|
- (NSString *)platformFlavorVersion {
|
|
700
|
-
return @"10.
|
|
740
|
+
return @"10.2.0";
|
|
701
741
|
}
|
|
702
742
|
|
|
703
743
|
@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.2.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",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
]
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@revenuecat/purchases-js-hybrid-mappings": "18.
|
|
119
|
-
"@revenuecat/purchases-typescript-internal": "18.
|
|
118
|
+
"@revenuecat/purchases-js-hybrid-mappings": "18.8.0",
|
|
119
|
+
"@revenuecat/purchases-typescript-internal": "18.8.0"
|
|
120
120
|
}
|
|
121
121
|
}
|