react-native-purchases 9.11.1 → 9.12.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 +12 -1
- package/dist/browser/nativeModule.d.ts +1 -0
- package/dist/browser/nativeModule.js +6 -0
- package/dist/purchases.d.ts +11 -0
- package/dist/purchases.js +22 -0
- package/ios/RNPurchases.m +9 -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 '9.
|
|
32
|
+
versionName '9.12.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:17.
|
|
124
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:17.46.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 = "9.
|
|
54
|
+
public static final String PLUGIN_VERSION = "9.12.0";
|
|
55
55
|
|
|
56
56
|
private final ReactApplicationContext reactContext;
|
|
57
57
|
|
|
@@ -138,6 +138,17 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
138
138
|
CommonKt.syncAttributesAndOfferingsIfNeeded(getOnResult(promise));
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
@ReactMethod
|
|
142
|
+
public void setAppstackAttributionParams(ReadableMap data, final Promise promise) {
|
|
143
|
+
HashMap<String, Object> dataMap = new HashMap<>();
|
|
144
|
+
for (Map.Entry<String, Object> entry : data.toHashMap().entrySet()) {
|
|
145
|
+
if (entry.getValue() != null) {
|
|
146
|
+
dataMap.put(entry.getKey(), entry.getValue());
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
CommonKt.setAppstackAttributionParams(dataMap, getOnResult(promise));
|
|
150
|
+
}
|
|
151
|
+
|
|
141
152
|
@ReactMethod
|
|
142
153
|
public void getProductInfo(ReadableArray productIDs, String type, final Promise promise) {
|
|
143
154
|
ArrayList<String> productIDList = new ArrayList<>();
|
|
@@ -9,6 +9,7 @@ export declare const browserNativeModuleRNPurchases: {
|
|
|
9
9
|
getOfferings: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
|
|
10
10
|
getCurrentOfferingForPlacement: (placementIdentifier: string) => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOffering | null>;
|
|
11
11
|
syncAttributesAndOfferingsIfNeeded: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
|
|
12
|
+
setAppstackAttributionParams: (_data: Record<string, any>) => Promise<void>;
|
|
12
13
|
getProductInfo: (_productIdentifiers: string[], _type: string) => Promise<void>;
|
|
13
14
|
restorePurchases: () => Promise<import("@revenuecat/purchases-typescript-internal").CustomerInfo>;
|
|
14
15
|
getAppUserID: () => Promise<string>;
|
|
@@ -120,6 +120,12 @@ exports.browserNativeModuleRNPurchases = {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
}); },
|
|
123
|
+
setAppstackAttributionParams: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
(0, utils_1.methodNotSupportedOnWeb)('setAppstackAttributionParams');
|
|
126
|
+
return [2 /*return*/];
|
|
127
|
+
});
|
|
128
|
+
}); },
|
|
123
129
|
getProductInfo: function (_productIdentifiers, _type) { return __awaiter(void 0, void 0, void 0, function () {
|
|
124
130
|
return __generator(this, function (_a) {
|
|
125
131
|
(0, utils_1.methodNotSupportedOnWeb)('getProductInfo');
|
package/dist/purchases.d.ts
CHANGED
|
@@ -186,6 +186,17 @@ export default class Purchases {
|
|
|
186
186
|
* has not been called yet.
|
|
187
187
|
*/
|
|
188
188
|
static syncAttributesAndOfferingsIfNeeded(): Promise<PurchasesOfferings>;
|
|
189
|
+
/**
|
|
190
|
+
* Sets attribution data from Appstack's attribution params, then syncs subscriber attributes and fetches
|
|
191
|
+
* fresh offerings so that Appstack-based targeting is applied before the promise resolves.
|
|
192
|
+
*
|
|
193
|
+
* Pass the object received from the Appstack Attribution SDK's `getAttributionParams()` directly.
|
|
194
|
+
* The SDK extracts relevant attribution info and sets the appropriate subscriber attributes.
|
|
195
|
+
*
|
|
196
|
+
* @param {object} data The attribution params from the Appstack Attribution SDK.
|
|
197
|
+
* @returns {Promise<PurchasesOfferings>} Promise of offerings targeted with Appstack data.
|
|
198
|
+
*/
|
|
199
|
+
static setAppstackAttributionParams(data: Record<string, any>): Promise<PurchasesOfferings>;
|
|
189
200
|
/**
|
|
190
201
|
* Fetch the product info
|
|
191
202
|
* @param {String[]} productIdentifiers Array of product identifiers
|
package/dist/purchases.js
CHANGED
|
@@ -320,6 +320,28 @@ var Purchases = /** @class */ (function () {
|
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
};
|
|
323
|
+
/**
|
|
324
|
+
* Sets attribution data from Appstack's attribution params, then syncs subscriber attributes and fetches
|
|
325
|
+
* fresh offerings so that Appstack-based targeting is applied before the promise resolves.
|
|
326
|
+
*
|
|
327
|
+
* Pass the object received from the Appstack Attribution SDK's `getAttributionParams()` directly.
|
|
328
|
+
* The SDK extracts relevant attribution info and sets the appropriate subscriber attributes.
|
|
329
|
+
*
|
|
330
|
+
* @param {object} data The attribution params from the Appstack Attribution SDK.
|
|
331
|
+
* @returns {Promise<PurchasesOfferings>} Promise of offerings targeted with Appstack data.
|
|
332
|
+
*/
|
|
333
|
+
Purchases.setAppstackAttributionParams = function (data) {
|
|
334
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
335
|
+
return __generator(this, function (_a) {
|
|
336
|
+
switch (_a.label) {
|
|
337
|
+
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
338
|
+
case 1:
|
|
339
|
+
_a.sent();
|
|
340
|
+
return [2 /*return*/, RNPurchases.setAppstackAttributionParams(data)];
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
};
|
|
323
345
|
/**
|
|
324
346
|
* Fetch the product info
|
|
325
347
|
* @param {String[]} productIdentifiers Array of product identifiers
|
package/ios/RNPurchases.m
CHANGED
|
@@ -104,6 +104,14 @@ RCT_REMAP_METHOD(syncAttributesAndOfferingsIfNeeded,
|
|
|
104
104
|
reject:reject]];
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
RCT_REMAP_METHOD(setAppstackAttributionParams,
|
|
108
|
+
setAppstackAttributionParamsWithData:(NSDictionary *)data
|
|
109
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
110
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
111
|
+
[RCCommonFunctionality setAppstackAttributionParams:data completionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
112
|
+
reject:reject]];
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
RCT_EXPORT_METHOD(getCurrentOfferingForPlacement:(NSString *)placementIdentifier
|
|
108
116
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
109
117
|
reject:(RCTPromiseRejectBlock)reject) {
|
|
@@ -681,7 +689,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
|
|
|
681
689
|
}
|
|
682
690
|
|
|
683
691
|
- (NSString *)platformFlavorVersion {
|
|
684
|
-
return @"9.
|
|
692
|
+
return @"9.12.0";
|
|
685
693
|
}
|
|
686
694
|
|
|
687
695
|
@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": "9.
|
|
4
|
+
"version": "9.12.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",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
]
|
|
115
115
|
},
|
|
116
116
|
"dependencies": {
|
|
117
|
-
"@revenuecat/purchases-js-hybrid-mappings": "17.
|
|
118
|
-
"@revenuecat/purchases-typescript-internal": "17.
|
|
117
|
+
"@revenuecat/purchases-js-hybrid-mappings": "17.46.1",
|
|
118
|
+
"@revenuecat/purchases-typescript-internal": "17.46.1"
|
|
119
119
|
}
|
|
120
120
|
}
|