react-native-purchases 10.8.0 → 10.9.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 +6 -1
- package/dist/browser/nativeModule.d.ts +1 -0
- package/dist/browser/nativeModule.js +7 -1
- package/dist/purchases.d.ts +15 -23
- package/dist/purchases.js +25 -7
- package/ios/RNPurchases.m +5 -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.9.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.33.1'
|
|
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.9.0";
|
|
55
55
|
|
|
56
56
|
private final ReactApplicationContext reactContext;
|
|
57
57
|
|
|
@@ -501,6 +501,11 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
501
501
|
SubscriberAttributesKt.setKochavaDeviceID(kochavaDeviceID);
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
+
@ReactMethod
|
|
505
|
+
public void setSingularDeviceID(String singularDeviceID) {
|
|
506
|
+
SubscriberAttributesKt.setSingularDeviceID(singularDeviceID);
|
|
507
|
+
}
|
|
508
|
+
|
|
504
509
|
@ReactMethod
|
|
505
510
|
public void setOnesignalID(String onesignalID) {
|
|
506
511
|
SubscriberAttributesKt.setOnesignalID(onesignalID);
|
|
@@ -63,6 +63,7 @@ export declare const browserNativeModuleRNPurchases: {
|
|
|
63
63
|
setFirebaseAppInstanceID: (_firebaseAppInstanceID: string) => Promise<void>;
|
|
64
64
|
setTenjinAnalyticsInstallationID: (_tenjinAnalyticsInstallationID: string) => Promise<void>;
|
|
65
65
|
setKochavaDeviceID: (_kochavaDeviceID: string) => Promise<void>;
|
|
66
|
+
setSingularDeviceID: (_singularDeviceID: string) => Promise<void>;
|
|
66
67
|
setOnesignalID: (_onesignalID: string) => Promise<void>;
|
|
67
68
|
setOnesignalUserID: (_onesignalUserID: string) => Promise<void>;
|
|
68
69
|
setAirshipChannelID: (_airshipChannelID: string) => Promise<void>;
|
|
@@ -43,7 +43,7 @@ var typeGuards_1 = require("./typeGuards");
|
|
|
43
43
|
var environment_1 = require("../utils/environment");
|
|
44
44
|
var utils_1 = require("./utils");
|
|
45
45
|
var purchaseSimulatedPackageHelper_1 = require("./simulatedstore/purchaseSimulatedPackageHelper");
|
|
46
|
-
var packageVersion = '10.
|
|
46
|
+
var packageVersion = '10.9.0';
|
|
47
47
|
/**
|
|
48
48
|
* Browser implementation of the native module. This will be used in the browser and Expo Go.
|
|
49
49
|
*/
|
|
@@ -457,6 +457,12 @@ exports.browserNativeModuleRNPurchases = {
|
|
|
457
457
|
return [2 /*return*/];
|
|
458
458
|
});
|
|
459
459
|
}); },
|
|
460
|
+
setSingularDeviceID: function (_singularDeviceID) { return __awaiter(void 0, void 0, void 0, function () {
|
|
461
|
+
return __generator(this, function (_a) {
|
|
462
|
+
(0, utils_1.methodNotSupportedOnWeb)('setSingularDeviceID');
|
|
463
|
+
return [2 /*return*/];
|
|
464
|
+
});
|
|
465
|
+
}); },
|
|
460
466
|
setOnesignalID: function (_onesignalID) { return __awaiter(void 0, void 0, void 0, function () {
|
|
461
467
|
return __generator(this, function (_a) {
|
|
462
468
|
(0, utils_1.methodNotSupportedOnWeb)('setOnesignalID');
|
package/dist/purchases.d.ts
CHANGED
|
@@ -43,17 +43,14 @@ export interface TrackCustomPaywallImpressionOptions {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Predefined mediator name constants. Use these or pass any string for unlisted networks.
|
|
46
|
-
* @beta
|
|
47
46
|
*/
|
|
48
47
|
export declare const AdMediatorName: {
|
|
49
48
|
readonly adMob: "AdMob";
|
|
50
49
|
readonly appLovin: "AppLovin";
|
|
51
50
|
};
|
|
52
|
-
/** @beta */
|
|
53
51
|
export type AdMediatorName = string;
|
|
54
52
|
/**
|
|
55
53
|
* Predefined ad format constants. Use these or pass any string for unlisted formats.
|
|
56
|
-
* @beta
|
|
57
54
|
*/
|
|
58
55
|
export declare const AdFormat: {
|
|
59
56
|
readonly other: "other";
|
|
@@ -64,11 +61,9 @@ export declare const AdFormat: {
|
|
|
64
61
|
readonly nativeAd: "native";
|
|
65
62
|
readonly appOpen: "app_open";
|
|
66
63
|
};
|
|
67
|
-
/** @beta */
|
|
68
64
|
export type AdFormat = string;
|
|
69
65
|
/**
|
|
70
66
|
* Predefined precision constants for ad revenue. Use these or pass any string for unlisted values.
|
|
71
|
-
* @beta
|
|
72
67
|
*/
|
|
73
68
|
export declare const AdRevenuePrecision: {
|
|
74
69
|
readonly exact: "exact";
|
|
@@ -76,9 +71,7 @@ export declare const AdRevenuePrecision: {
|
|
|
76
71
|
readonly estimated: "estimated";
|
|
77
72
|
readonly unknown: "unknown";
|
|
78
73
|
};
|
|
79
|
-
/** @beta */
|
|
80
74
|
export type AdRevenuePrecision = string;
|
|
81
|
-
/** @beta */
|
|
82
75
|
export interface AdDisplayedData {
|
|
83
76
|
mediatorName: AdMediatorName;
|
|
84
77
|
adFormat: AdFormat;
|
|
@@ -87,7 +80,6 @@ export interface AdDisplayedData {
|
|
|
87
80
|
networkName?: string | null;
|
|
88
81
|
placement?: string | null;
|
|
89
82
|
}
|
|
90
|
-
/** @beta */
|
|
91
83
|
export interface AdOpenedData {
|
|
92
84
|
mediatorName: AdMediatorName;
|
|
93
85
|
adFormat: AdFormat;
|
|
@@ -96,7 +88,6 @@ export interface AdOpenedData {
|
|
|
96
88
|
networkName?: string | null;
|
|
97
89
|
placement?: string | null;
|
|
98
90
|
}
|
|
99
|
-
/** @beta */
|
|
100
91
|
export interface AdLoadedData {
|
|
101
92
|
mediatorName: AdMediatorName;
|
|
102
93
|
adFormat: AdFormat;
|
|
@@ -105,7 +96,6 @@ export interface AdLoadedData {
|
|
|
105
96
|
networkName?: string | null;
|
|
106
97
|
placement?: string | null;
|
|
107
98
|
}
|
|
108
|
-
/** @beta */
|
|
109
99
|
export interface AdRevenueData {
|
|
110
100
|
mediatorName: AdMediatorName;
|
|
111
101
|
adFormat: AdFormat;
|
|
@@ -117,7 +107,6 @@ export interface AdRevenueData {
|
|
|
117
107
|
networkName?: string | null;
|
|
118
108
|
placement?: string | null;
|
|
119
109
|
}
|
|
120
|
-
/** @beta */
|
|
121
110
|
export interface AdFailedToLoadData {
|
|
122
111
|
mediatorName: AdMediatorName;
|
|
123
112
|
adFormat: AdFormat;
|
|
@@ -129,7 +118,6 @@ export interface AdFailedToLoadData {
|
|
|
129
118
|
* Token generated for a rewarded ad impression. Pass `clientTransactionId` to
|
|
130
119
|
* the ad network as server-side verification custom data, then to
|
|
131
120
|
* {@link Purchases.pollRewardVerification} to await the reward.
|
|
132
|
-
* @beta
|
|
133
121
|
*/
|
|
134
122
|
export interface RewardVerificationToken {
|
|
135
123
|
customData: string;
|
|
@@ -138,16 +126,13 @@ export interface RewardVerificationToken {
|
|
|
138
126
|
}
|
|
139
127
|
/**
|
|
140
128
|
* A reward granted after a verified rewarded ad. Discriminated by `type`.
|
|
141
|
-
* @beta
|
|
142
129
|
*/
|
|
143
130
|
export type VerifiedReward = VerifiedVirtualCurrencyReward | VerifiedEntitlementReward | VerifiedNoReward | VerifiedUnsupportedReward;
|
|
144
|
-
/** @beta */
|
|
145
131
|
export interface VerifiedVirtualCurrencyReward {
|
|
146
132
|
type: "virtual_currency";
|
|
147
133
|
code: string;
|
|
148
134
|
amount: number;
|
|
149
135
|
}
|
|
150
|
-
/** @beta */
|
|
151
136
|
export interface VerifiedEntitlementReward {
|
|
152
137
|
type: "entitlement";
|
|
153
138
|
identifier: string;
|
|
@@ -156,17 +141,16 @@ export interface VerifiedEntitlementReward {
|
|
|
156
141
|
/** Expiration date in milliseconds since epoch. */
|
|
157
142
|
expiresAtMillis: number;
|
|
158
143
|
}
|
|
159
|
-
/** Verification completed but nothing was granted.
|
|
144
|
+
/** Verification completed but nothing was granted. */
|
|
160
145
|
export interface VerifiedNoReward {
|
|
161
146
|
type: "no_reward";
|
|
162
147
|
}
|
|
163
|
-
/** Verification completed but the reward type isn't modeled by this SDK version.
|
|
148
|
+
/** Verification completed but the reward type isn't modeled by this SDK version. */
|
|
164
149
|
export interface VerifiedUnsupportedReward {
|
|
165
150
|
type: "unsupported_reward";
|
|
166
151
|
}
|
|
167
152
|
/**
|
|
168
153
|
* Result of polling for reward verification.
|
|
169
|
-
* @beta
|
|
170
154
|
*/
|
|
171
155
|
export interface RewardVerificationResult {
|
|
172
156
|
/** The primary reward when verification succeeded; absent on failure. */
|
|
@@ -179,7 +163,6 @@ export interface RewardVerificationResult {
|
|
|
179
163
|
/**
|
|
180
164
|
* Ad metadata for a rewarded ad, passed to {@link Purchases.pollRewardVerification}
|
|
181
165
|
* to have the SDK automatically track reward-verification events for it.
|
|
182
|
-
* @beta
|
|
183
166
|
*/
|
|
184
167
|
export interface RewardedAdTrackingMetadata {
|
|
185
168
|
mediatorName: AdMediatorName;
|
|
@@ -846,6 +829,19 @@ export default class Purchases {
|
|
|
846
829
|
* setting the Kochava Device ID.
|
|
847
830
|
*/
|
|
848
831
|
static setKochavaDeviceID(kochavaDeviceID: string | null): Promise<void>;
|
|
832
|
+
/**
|
|
833
|
+
* Subscriber attribute associated with the Singular Device ID (SDID) for the user.
|
|
834
|
+
* Required for the RevenueCat Singular integration when using Singular's Event
|
|
835
|
+
* Endpoint V2.
|
|
836
|
+
*
|
|
837
|
+
* The SDID is generated by the Singular SDK and cannot be collected by
|
|
838
|
+
* collectDeviceIdentifiers, so it has to be forwarded by the app.
|
|
839
|
+
*
|
|
840
|
+
* @param singularDeviceID Singular device ID to use in the Singular integration. Empty String or null will delete the subscriber attribute.
|
|
841
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
842
|
+
* setting the Singular Device ID.
|
|
843
|
+
*/
|
|
844
|
+
static setSingularDeviceID(singularDeviceID: string | null): Promise<void>;
|
|
849
845
|
/**
|
|
850
846
|
* Subscriber attribute associated with the OneSignal Player Id for the user
|
|
851
847
|
* Required for the RevenueCat OneSignal integration with OneSignal SDK v4.0 and below
|
|
@@ -1066,7 +1062,6 @@ export default class Purchases {
|
|
|
1066
1062
|
static isConfigured(): Promise<boolean>;
|
|
1067
1063
|
/**
|
|
1068
1064
|
* Provides access to ad lifecycle tracking methods.
|
|
1069
|
-
* @beta
|
|
1070
1065
|
*/
|
|
1071
1066
|
static get adTracker(): PurchasesAdTracker;
|
|
1072
1067
|
/**
|
|
@@ -1091,7 +1086,6 @@ export default class Purchases {
|
|
|
1091
1086
|
*
|
|
1092
1087
|
* @param impressionId - The impression identifier of the rewarded ad.
|
|
1093
1088
|
* @returns {Promise<RewardVerificationToken>} promise with the generated token.
|
|
1094
|
-
* @beta
|
|
1095
1089
|
*/
|
|
1096
1090
|
static generateRewardVerificationToken(impressionId: string): Promise<RewardVerificationToken>;
|
|
1097
1091
|
/**
|
|
@@ -1107,7 +1101,6 @@ export default class Purchases {
|
|
|
1107
1101
|
* reward-verification events for the ad it belongs to; omit to poll
|
|
1108
1102
|
* without tracking.
|
|
1109
1103
|
* @returns {Promise<RewardVerificationResult>} promise with the verification result.
|
|
1110
|
-
* @beta
|
|
1111
1104
|
*/
|
|
1112
1105
|
static pollRewardVerification(clientTransactionId: string, trackingMetadata?: RewardedAdTrackingMetadata): Promise<RewardVerificationResult>;
|
|
1113
1106
|
private static throwIfAndroidPlatform;
|
|
@@ -1118,7 +1111,6 @@ export default class Purchases {
|
|
|
1118
1111
|
/**
|
|
1119
1112
|
* Provides methods for tracking ad lifecycle events.
|
|
1120
1113
|
* Access via {@link Purchases.adTracker}.
|
|
1121
|
-
* @beta
|
|
1122
1114
|
*/
|
|
1123
1115
|
export declare class PurchasesAdTracker {
|
|
1124
1116
|
trackAdDisplayed(data: AdDisplayedData): Promise<void>;
|
package/dist/purchases.js
CHANGED
|
@@ -82,7 +82,6 @@ var customLogHandler;
|
|
|
82
82
|
var trackedEventListeners = [];
|
|
83
83
|
/**
|
|
84
84
|
* Predefined mediator name constants. Use these or pass any string for unlisted networks.
|
|
85
|
-
* @beta
|
|
86
85
|
*/
|
|
87
86
|
exports.AdMediatorName = {
|
|
88
87
|
adMob: "AdMob",
|
|
@@ -90,7 +89,6 @@ exports.AdMediatorName = {
|
|
|
90
89
|
};
|
|
91
90
|
/**
|
|
92
91
|
* Predefined ad format constants. Use these or pass any string for unlisted formats.
|
|
93
|
-
* @beta
|
|
94
92
|
*/
|
|
95
93
|
exports.AdFormat = {
|
|
96
94
|
other: "other",
|
|
@@ -103,7 +101,6 @@ exports.AdFormat = {
|
|
|
103
101
|
};
|
|
104
102
|
/**
|
|
105
103
|
* Predefined precision constants for ad revenue. Use these or pass any string for unlisted values.
|
|
106
|
-
* @beta
|
|
107
104
|
*/
|
|
108
105
|
exports.AdRevenuePrecision = {
|
|
109
106
|
exact: "exact",
|
|
@@ -1549,6 +1546,31 @@ var Purchases = /** @class */ (function () {
|
|
|
1549
1546
|
});
|
|
1550
1547
|
});
|
|
1551
1548
|
};
|
|
1549
|
+
/**
|
|
1550
|
+
* Subscriber attribute associated with the Singular Device ID (SDID) for the user.
|
|
1551
|
+
* Required for the RevenueCat Singular integration when using Singular's Event
|
|
1552
|
+
* Endpoint V2.
|
|
1553
|
+
*
|
|
1554
|
+
* The SDID is generated by the Singular SDK and cannot be collected by
|
|
1555
|
+
* collectDeviceIdentifiers, so it has to be forwarded by the app.
|
|
1556
|
+
*
|
|
1557
|
+
* @param singularDeviceID Singular device ID to use in the Singular integration. Empty String or null will delete the subscriber attribute.
|
|
1558
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
1559
|
+
* setting the Singular Device ID.
|
|
1560
|
+
*/
|
|
1561
|
+
Purchases.setSingularDeviceID = function (singularDeviceID) {
|
|
1562
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1563
|
+
return __generator(this, function (_a) {
|
|
1564
|
+
switch (_a.label) {
|
|
1565
|
+
case 0: return [4 /*yield*/, throwIfNotConfigured()];
|
|
1566
|
+
case 1:
|
|
1567
|
+
_a.sent();
|
|
1568
|
+
RNPurchases.setSingularDeviceID(singularDeviceID);
|
|
1569
|
+
return [2 /*return*/];
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
1572
|
+
});
|
|
1573
|
+
};
|
|
1552
1574
|
/**
|
|
1553
1575
|
* Subscriber attribute associated with the OneSignal Player Id for the user
|
|
1554
1576
|
* Required for the RevenueCat OneSignal integration with OneSignal SDK v4.0 and below
|
|
@@ -2069,7 +2091,6 @@ var Purchases = /** @class */ (function () {
|
|
|
2069
2091
|
Object.defineProperty(Purchases, "adTracker", {
|
|
2070
2092
|
/**
|
|
2071
2093
|
* Provides access to ad lifecycle tracking methods.
|
|
2072
|
-
* @beta
|
|
2073
2094
|
*/
|
|
2074
2095
|
get: function () {
|
|
2075
2096
|
if (!adTrackerSingleton) {
|
|
@@ -2123,7 +2144,6 @@ var Purchases = /** @class */ (function () {
|
|
|
2123
2144
|
*
|
|
2124
2145
|
* @param impressionId - The impression identifier of the rewarded ad.
|
|
2125
2146
|
* @returns {Promise<RewardVerificationToken>} promise with the generated token.
|
|
2126
|
-
* @beta
|
|
2127
2147
|
*/
|
|
2128
2148
|
Purchases.generateRewardVerificationToken = function (impressionId) {
|
|
2129
2149
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2150,7 +2170,6 @@ var Purchases = /** @class */ (function () {
|
|
|
2150
2170
|
* reward-verification events for the ad it belongs to; omit to poll
|
|
2151
2171
|
* without tracking.
|
|
2152
2172
|
* @returns {Promise<RewardVerificationResult>} promise with the verification result.
|
|
2153
|
-
* @beta
|
|
2154
2173
|
*/
|
|
2155
2174
|
Purchases.pollRewardVerification = function (clientTransactionId, trackingMetadata) {
|
|
2156
2175
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2303,7 +2322,6 @@ var adTrackerSingleton;
|
|
|
2303
2322
|
/**
|
|
2304
2323
|
* Provides methods for tracking ad lifecycle events.
|
|
2305
2324
|
* Access via {@link Purchases.adTracker}.
|
|
2306
|
-
* @beta
|
|
2307
2325
|
*/
|
|
2308
2326
|
var PurchasesAdTracker = /** @class */ (function () {
|
|
2309
2327
|
function PurchasesAdTracker() {
|
package/ios/RNPurchases.m
CHANGED
|
@@ -441,6 +441,10 @@ RCT_EXPORT_METHOD(setKochavaDeviceID:(NSString *)kochavaDeviceID) {
|
|
|
441
441
|
[RCCommonFunctionality setKochavaDeviceID:kochavaDeviceID.mappingNSNullToNil];
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
+
RCT_EXPORT_METHOD(setSingularDeviceID:(NSString *)singularDeviceID) {
|
|
445
|
+
[RCCommonFunctionality setSingularDeviceID:singularDeviceID.mappingNSNullToNil];
|
|
446
|
+
}
|
|
447
|
+
|
|
444
448
|
RCT_EXPORT_METHOD(setOnesignalID:(NSString *)onesignalID) {
|
|
445
449
|
[RCCommonFunctionality setOnesignalID:onesignalID.mappingNSNullToNil];
|
|
446
450
|
}
|
|
@@ -785,7 +789,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
|
|
|
785
789
|
}
|
|
786
790
|
|
|
787
791
|
- (NSString *)platformFlavorVersion {
|
|
788
|
-
return @"10.
|
|
792
|
+
return @"10.9.0";
|
|
789
793
|
}
|
|
790
794
|
|
|
791
795
|
@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.9.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.33.1",
|
|
122
|
+
"@revenuecat/purchases-typescript-internal": "18.33.1"
|
|
123
123
|
}
|
|
124
124
|
}
|