react-native-purchases 4.4.1 → 4.5.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/.classpath +6 -0
- package/android/.project +34 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build.gradle +2 -2
- package/android/build.gradle.bck +127 -0
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +5 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +27 -1
- package/dist/purchases.d.ts +168 -80
- package/dist/purchases.js +682 -127
- package/ios/RNPurchases.m +7 -1
- package/ios/RNPurchases.m.bck +374 -0
- package/package.json +1 -1
- package/scripts/build.js +2 -2
- package/scripts/build.js.bck +19 -0
- package/scripts/setupJest.js +2 -1
package/RNPurchases.podspec
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<classpath>
|
|
3
|
+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
|
|
4
|
+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
|
5
|
+
<classpathentry kind="output" path="bin/default"/>
|
|
6
|
+
</classpath>
|
package/android/.project
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<projectDescription>
|
|
3
|
+
<name>android</name>
|
|
4
|
+
<comment>Project ReactNativeSample-react-native-purchases created by Buildship.</comment>
|
|
5
|
+
<projects>
|
|
6
|
+
</projects>
|
|
7
|
+
<buildSpec>
|
|
8
|
+
<buildCommand>
|
|
9
|
+
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
10
|
+
<arguments>
|
|
11
|
+
</arguments>
|
|
12
|
+
</buildCommand>
|
|
13
|
+
<buildCommand>
|
|
14
|
+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
15
|
+
<arguments>
|
|
16
|
+
</arguments>
|
|
17
|
+
</buildCommand>
|
|
18
|
+
</buildSpec>
|
|
19
|
+
<natures>
|
|
20
|
+
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
21
|
+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
22
|
+
</natures>
|
|
23
|
+
<filteredResources>
|
|
24
|
+
<filter>
|
|
25
|
+
<id>0</id>
|
|
26
|
+
<name></name>
|
|
27
|
+
<type>30</type>
|
|
28
|
+
<matcher>
|
|
29
|
+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
30
|
+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
31
|
+
</matcher>
|
|
32
|
+
</filter>
|
|
33
|
+
</filteredResources>
|
|
34
|
+
</projectDescription>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
arguments=
|
|
2
|
+
auto.sync=false
|
|
3
|
+
build.scans.enabled=false
|
|
4
|
+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
|
5
|
+
connection.project.dir=
|
|
6
|
+
eclipse.preferences.version=1
|
|
7
|
+
gradle.user.home=
|
|
8
|
+
java.home=/Users/cesardelavega/.sdkman/candidates/java/current
|
|
9
|
+
jvm.arguments=
|
|
10
|
+
offline.mode=false
|
|
11
|
+
override.workspace.settings=true
|
|
12
|
+
show.console.view=true
|
|
13
|
+
show.executions.view=true
|
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 '4.
|
|
32
|
+
versionName '4.5.0'
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
buildTypes {
|
|
@@ -122,6 +122,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
|
122
122
|
dependencies {
|
|
123
123
|
//noinspection GradleDynamicVersion
|
|
124
124
|
api 'com.facebook.react:react-native:+'
|
|
125
|
-
implementation 'com.revenuecat.purchases:purchases-hybrid-common:1.
|
|
125
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:1.11.1'
|
|
126
126
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
127
127
|
}
|
|
@@ -0,0 +1,127 @@
|
|
|
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.4.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:1.11.1'
|
|
126
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
127
|
+
}
|
|
@@ -234,6 +234,11 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
234
234
|
CommonKt.setProxyURLString(proxyURLString);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
@ReactMethod
|
|
238
|
+
public void isConfigured(Promise promise) {
|
|
239
|
+
promise.resolve(Purchases.isConfigured());
|
|
240
|
+
}
|
|
241
|
+
|
|
237
242
|
//================================================================================
|
|
238
243
|
// Subscriber Attributes
|
|
239
244
|
//================================================================================
|
package/dist/errors.d.ts
CHANGED
package/dist/errors.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
2
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PURCHASES_ERROR_CODE = void 0;
|
|
16
|
+
exports.UninitializedPurchasesError = exports.PURCHASES_ERROR_CODE = void 0;
|
|
4
17
|
// Error codes indicating the reason for an error.
|
|
5
18
|
var PURCHASES_ERROR_CODE;
|
|
6
19
|
(function (PURCHASES_ERROR_CODE) {
|
|
@@ -28,3 +41,16 @@ var PURCHASES_ERROR_CODE;
|
|
|
28
41
|
PURCHASES_ERROR_CODE["INVALID_SUBSCRIBER_ATTRIBUTES_ERROR"] = "21";
|
|
29
42
|
PURCHASES_ERROR_CODE["LOG_OUT_ANONYMOUS_USER_ERROR"] = "22";
|
|
30
43
|
})(PURCHASES_ERROR_CODE = exports.PURCHASES_ERROR_CODE || (exports.PURCHASES_ERROR_CODE = {}));
|
|
44
|
+
var UninitializedPurchasesError = /** @class */ (function (_super) {
|
|
45
|
+
__extends(UninitializedPurchasesError, _super);
|
|
46
|
+
function UninitializedPurchasesError() {
|
|
47
|
+
var _this = _super.call(this, "There is no singleton instance. " +
|
|
48
|
+
"Make sure you configure Purchases before trying to get the default instance. " +
|
|
49
|
+
"More info here: https://errors.rev.cat/configuring-sdk") || this;
|
|
50
|
+
// Set the prototype explicitly.
|
|
51
|
+
Object.setPrototypeOf(_this, UninitializedPurchasesError.prototype);
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
return UninitializedPurchasesError;
|
|
55
|
+
}(Error));
|
|
56
|
+
exports.UninitializedPurchasesError = UninitializedPurchasesError;
|