react-native-purchases 4.5.2 → 4.6.1

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.
@@ -2,7 +2,7 @@ buildscript {
2
2
  def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['Purchases_kotlinVersion']
3
3
  repositories {
4
4
  google()
5
- jcenter()
5
+ mavenCentral()
6
6
  }
7
7
 
8
8
  dependencies {
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '4.5.2'
32
+ versionName '4.6.1'
33
33
  }
34
34
 
35
35
  buildTypes {
@@ -48,7 +48,6 @@ android {
48
48
 
49
49
  repositories {
50
50
  mavenCentral()
51
- jcenter()
52
51
  google()
53
52
 
54
53
  def found = false
@@ -43,7 +43,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
43
43
 
44
44
  private static final String PURCHASER_INFO_UPDATED = "Purchases-PurchaserInfoUpdated";
45
45
  public static final String PLATFORM_NAME = "react-native";
46
- public static final String PLUGIN_VERSION = "4.4.1";
46
+ public static final String PLUGIN_VERSION = "4.6.1";
47
47
 
48
48
  private final ReactApplicationContext reactContext;
49
49
 
@@ -67,6 +67,16 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
67
67
  }
68
68
  }
69
69
 
70
+ @ReactMethod
71
+ public void addListener(String eventName) {
72
+ // Keep: Required for RN built in Event Emitter Calls.
73
+ }
74
+
75
+ @ReactMethod
76
+ public void removeListeners(Integer count) {
77
+ // Keep: Required for RN built in Event Emitter Calls.
78
+ }
79
+
70
80
  @ReactMethod
71
81
  public void setupPurchases(String apiKey, @Nullable String appUserID,
72
82
  boolean observerMode, @Nullable String userDefaultsSuiteName) {
@@ -8,7 +8,7 @@ import { PRORATION_MODE, PACKAGE_TYPE, INTRO_ELIGIBILITY_STATUS, PurchasesOfferi
8
8
  */
9
9
  export declare type PurchaserInfoUpdateListener = (purchaserInfo: PurchaserInfo) => void;
10
10
  export declare type ShouldPurchasePromoProductListener = (deferredPurchase: () => Promise<MakePurchaseResult>) => void;
11
- declare type MakePurchaseResult = {
11
+ export declare type MakePurchaseResult = {
12
12
  productIdentifier: string;
13
13
  purchaserInfo: PurchaserInfo;
14
14
  };
@@ -578,4 +578,3 @@ export default class Purchases {
578
578
  static isConfigured(): Promise<boolean>;
579
579
  private static throwIfNotConfigured;
580
580
  }
581
- export {};
package/ios/RNPurchases.m CHANGED
@@ -369,7 +369,7 @@ shouldPurchasePromoProduct:(SKProduct *)product
369
369
  }
370
370
 
371
371
  - (NSString *)platformFlavorVersion {
372
- return @"4.5.2";
372
+ return @"4.6.1";
373
373
  }
374
374
 
375
375
  @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": "4.5.2",
4
+ "version": "4.6.1",
5
5
  "description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android. ",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,127 +0,0 @@
1
- buildscript {
2
- def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['Purchases_kotlinVersion']
3
- repositories {
4
- google()
5
- jcenter()
6
- }
7
-
8
- dependencies {
9
- classpath 'com.android.tools.build:gradle:4.0.1'
10
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11
- }
12
- }
13
-
14
- apply plugin: 'com.android.library'
15
- apply plugin: 'kotlin-android'
16
-
17
- def getExtOrDefault(name) {
18
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Purchases_' + name]
19
- }
20
-
21
- def getExtOrIntegerDefault(name) {
22
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['Purchases_' + name]).toInteger()
23
- }
24
-
25
- android {
26
- compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
27
-
28
- defaultConfig {
29
- minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
- targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
- versionCode 1
32
- versionName '4.5.1'
33
- }
34
-
35
- buildTypes {
36
- release {
37
- minifyEnabled false
38
- }
39
- }
40
- lintOptions {
41
- disable 'GradleCompatible'
42
- }
43
- compileOptions {
44
- sourceCompatibility JavaVersion.VERSION_1_8
45
- targetCompatibility JavaVersion.VERSION_1_8
46
- }
47
- }
48
-
49
- repositories {
50
- mavenCentral()
51
- jcenter()
52
- google()
53
-
54
- def found = false
55
- def defaultDir = null
56
- def androidSourcesName = 'React Native sources'
57
-
58
- if (rootProject.ext.has('reactNativeAndroidRoot')) {
59
- defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
60
- } else {
61
- defaultDir = new File(
62
- projectDir,
63
- '/../../../node_modules/react-native/android'
64
- )
65
- }
66
-
67
- if (defaultDir.exists()) {
68
- maven {
69
- url defaultDir.toString()
70
- name androidSourcesName
71
- }
72
-
73
- logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
74
- found = true
75
- } else {
76
- def parentDir = rootProject.projectDir
77
-
78
- 1.upto(5, {
79
- if (found) return true
80
- parentDir = parentDir.parentFile
81
-
82
- def androidSourcesDir = new File(
83
- parentDir,
84
- 'node_modules/react-native'
85
- )
86
-
87
- def androidPrebuiltBinaryDir = new File(
88
- parentDir,
89
- 'node_modules/react-native/android'
90
- )
91
-
92
- if (androidPrebuiltBinaryDir.exists()) {
93
- maven {
94
- url androidPrebuiltBinaryDir.toString()
95
- name androidSourcesName
96
- }
97
-
98
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
99
- found = true
100
- } else if (androidSourcesDir.exists()) {
101
- maven {
102
- url androidSourcesDir.toString()
103
- name androidSourcesName
104
- }
105
-
106
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
107
- found = true
108
- }
109
- })
110
- }
111
-
112
- if (!found) {
113
- throw new GradleException(
114
- "${project.name}: unable to locate React Native android sources. " +
115
- "Ensure you have you installed React Native as a dependency in your project and try again."
116
- )
117
- }
118
- }
119
-
120
- def kotlin_version = getExtOrDefault('kotlinVersion')
121
-
122
- dependencies {
123
- //noinspection GradleDynamicVersion
124
- api 'com.facebook.react:react-native:+'
125
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:2.0.1'
126
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
127
- }
@@ -1,19 +0,0 @@
1
- const {exec} = require("child_process");
2
- const os = require("os");
3
-
4
- if (os.type() === "Linux") {
5
- console.log("Skipping iOS Dependencies");
6
- } else if (os.type() === "Darwin") {
7
- const downloadProcess = exec(
8
- "./scripts/download-purchases-framework.sh 3.14.1"
9
- );
10
- downloadProcess.stdout.pipe(process.stdout);
11
- const downloadProcessCommon = exec(
12
- "./scripts/download-purchases-common.sh 1.11.1"
13
- );
14
- downloadProcessCommon.stdout.pipe(process.stdout);
15
- } else if (os.type() === "Windows_NT") {
16
- console.log("Skipping iOS Dependencies");
17
- } else {
18
- throw new Error(`Unsupported OS found: ${os.type()}`);
19
- }