react-native-purchases 10.13.1 → 10.15.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.
@@ -35,7 +35,7 @@ android {
35
35
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
36
36
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
37
37
  versionCode 1
38
- versionName '10.13.1'
38
+ versionName '10.15.0'
39
39
  }
40
40
 
41
41
  buildTypes {
@@ -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.13.1";
54
+ public static final String PLUGIN_VERSION = "10.15.0";
55
55
 
56
56
  private final ReactApplicationContext reactContext;
57
57
 
@@ -667,6 +667,11 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
667
667
  CommonKt.trackAdFailedToLoad(data.toHashMap());
668
668
  }
669
669
 
670
+ @ReactMethod
671
+ public void trackAdRewardEarnedUnverified(ReadableMap data) {
672
+ CommonKt.trackAdRewardEarnedUnverified(data.toHashMap());
673
+ }
674
+
670
675
  @ReactMethod
671
676
  public void trackRewardedAdPromptShown(ReadableMap data) {
672
677
  CommonKt.trackRewardedAdPromptShown(data.toHashMap());
@@ -93,6 +93,7 @@ export declare const browserNativeModuleRNPurchases: {
93
93
  trackAdLoaded: (_data: any) => Promise<void>;
94
94
  trackAdRevenue: (_data: any) => Promise<void>;
95
95
  trackAdFailedToLoad: (_data: any) => Promise<void>;
96
+ trackAdRewardEarnedUnverified: (_data: any) => Promise<void>;
96
97
  trackRewardedAdPromptShown: (_data: any) => Promise<void>;
97
98
  trackRewardedAdPromptAccepted: (_data: any) => Promise<void>;
98
99
  generateRewardVerificationToken: (_impressionId: 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.13.1';
46
+ var packageVersion = '10.15.0';
47
47
  /**
48
48
  * Browser implementation of the native module. This will be used in the browser and Expo Go.
49
49
  */
@@ -645,6 +645,12 @@ exports.browserNativeModuleRNPurchases = {
645
645
  return [2 /*return*/];
646
646
  });
647
647
  }); },
648
+ trackAdRewardEarnedUnverified: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
649
+ return __generator(this, function (_a) {
650
+ (0, utils_1.methodNotSupportedOnWeb)('trackAdRewardEarnedUnverified');
651
+ return [2 /*return*/];
652
+ });
653
+ }); },
648
654
  trackRewardedAdPromptShown: function (_data) { return __awaiter(void 0, void 0, void 0, function () {
649
655
  return __generator(this, function (_a) {
650
656
  (0, utils_1.methodNotSupportedOnWeb)('trackRewardedAdPromptShown');
@@ -72,6 +72,15 @@ export declare const AdRevenuePrecision: {
72
72
  readonly unknown: "unknown";
73
73
  };
74
74
  export type AdRevenuePrecision = string;
75
+ /**
76
+ * Identifies the integration that emitted an ad event. Reserved for the
77
+ * official RevenueCat ad-network adapters (for example
78
+ * `react-native-purchases-admob`); leave it unset when tracking manually.
79
+ */
80
+ export declare const AdCaptureMethod: {
81
+ readonly reactNativeAdMobAdapter: "react_native_admob_adapter";
82
+ };
83
+ export type AdCaptureMethod = string;
75
84
  export interface AdDisplayedData {
76
85
  mediatorName: AdMediatorName;
77
86
  adFormat: AdFormat;
@@ -114,6 +123,14 @@ export interface AdFailedToLoadData {
114
123
  mediatorErrorCode?: number | null;
115
124
  placement?: string | null;
116
125
  }
126
+ export interface AdRewardEarnedUnverifiedData {
127
+ mediatorName: AdMediatorName;
128
+ adFormat: AdFormat;
129
+ adUnitId: string;
130
+ impressionId: string;
131
+ networkName?: string | null;
132
+ placement?: string | null;
133
+ }
117
134
  export interface AdRewardPromptShownData {
118
135
  mediatorName: AdMediatorName;
119
136
  adUnitId: string;
@@ -1136,6 +1153,7 @@ export declare class PurchasesAdTracker {
1136
1153
  trackAdLoaded(data: AdLoadedData): Promise<void>;
1137
1154
  trackAdRevenue(data: AdRevenueData): Promise<void>;
1138
1155
  trackAdFailedToLoad(data: AdFailedToLoadData): Promise<void>;
1156
+ trackAdRewardEarnedUnverified(data: AdRewardEarnedUnverifiedData): Promise<void>;
1139
1157
  trackRewardedAdPromptShown(data: AdRewardPromptShownData): Promise<void>;
1140
1158
  trackRewardedAdPromptAccepted(data: AdRewardPromptAcceptedData): Promise<void>;
1141
1159
  }
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.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;
39
+ exports.PurchasesAdTracker = exports.AdCaptureMethod = 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 normalizingRejections_1 = require("./normalizingRejections");
@@ -110,6 +110,14 @@ exports.AdRevenuePrecision = {
110
110
  estimated: "estimated",
111
111
  unknown: "unknown",
112
112
  };
113
+ /**
114
+ * Identifies the integration that emitted an ad event. Reserved for the
115
+ * official RevenueCat ad-network adapters (for example
116
+ * `react-native-purchases-admob`); leave it unset when tracking manually.
117
+ */
118
+ exports.AdCaptureMethod = {
119
+ reactNativeAdMobAdapter: "react_native_admob_adapter",
120
+ };
113
121
  var debugEventListeners = [];
114
122
  eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.addListener("Purchases-CustomerInfoUpdated", function (event) {
115
123
  var customerInfo = event;
@@ -2372,6 +2380,19 @@ var PurchasesAdTracker = /** @class */ (function () {
2372
2380
  });
2373
2381
  });
2374
2382
  };
2383
+ PurchasesAdTracker.prototype.trackAdRewardEarnedUnverified = function (data) {
2384
+ return __awaiter(this, void 0, void 0, function () {
2385
+ return __generator(this, function (_a) {
2386
+ switch (_a.label) {
2387
+ case 0: return [4 /*yield*/, throwIfNotConfigured()];
2388
+ case 1:
2389
+ _a.sent();
2390
+ RNPurchases.trackAdRewardEarnedUnverified(data);
2391
+ return [2 /*return*/];
2392
+ }
2393
+ });
2394
+ });
2395
+ };
2375
2396
  PurchasesAdTracker.prototype.trackRewardedAdPromptShown = function (data) {
2376
2397
  return __awaiter(this, void 0, void 0, function () {
2377
2398
  return __generator(this, function (_a) {
package/ios/RNPurchases.m CHANGED
@@ -701,6 +701,14 @@ RCT_EXPORT_METHOD(trackAdFailedToLoad:(NSDictionary *)data) {
701
701
  }
702
702
  }
703
703
 
704
+ RCT_EXPORT_METHOD(trackAdRewardEarnedUnverified:(NSDictionary *)data) {
705
+ if (@available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *)) {
706
+ [RCCommonFunctionality trackAdRewardEarnedUnverified:data];
707
+ } else {
708
+ NSLog(@"[Purchases] Warning: tried to call trackAdRewardEarnedUnverified, but it's only available on iOS 15.0 or greater.");
709
+ }
710
+ }
711
+
704
712
  RCT_EXPORT_METHOD(trackRewardedAdPromptShown:(NSDictionary *)data) {
705
713
  if (@available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *)) {
706
714
  [RCCommonFunctionality trackRewardedAdPromptShown:data];
@@ -805,7 +813,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
805
813
  }
806
814
 
807
815
  - (NSString *)platformFlavorVersion {
808
- return @"10.13.1";
816
+ return @"10.15.0";
809
817
  }
810
818
 
811
819
  @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.13.1",
4
+ "version": "10.15.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",
@@ -28,6 +28,7 @@
28
28
  "!**/*.iml",
29
29
  "!**/.DS_Store",
30
30
  "!**/.gitignore",
31
+ "!react-native-purchases-admob",
31
32
  "!react-native-purchases-store-galaxy",
32
33
  "!react-native-purchases-ui",
33
34
  "!scripts/docs/index.html",
@@ -47,6 +48,7 @@
47
48
  },
48
49
  "workspaces": [
49
50
  "examples/purchaseTesterTypescript",
51
+ "react-native-purchases-admob",
50
52
  "react-native-purchases-store-galaxy",
51
53
  "react-native-purchases-ui",
52
54
  "e2e-tests/MaestroTestApp"
@@ -108,6 +110,7 @@
108
110
  "preset": "@react-native/jest-preset",
109
111
  "modulePathIgnorePatterns": [
110
112
  "<rootDir>/examples/purchaseTesterTypescript/",
113
+ "<rootDir>/react-native-purchases-admob/",
111
114
  "<rootDir>/react-native-purchases-store-galaxy/",
112
115
  "<rootDir>/react-native-purchases-ui/",
113
116
  "<rootDir>/dir/"