react-native-purchases 7.4.0-beta.2 → 7.4.0-beta.3
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 +1 -1
- package/ios/RNPaywallManager.m +2 -2
- package/ios/RNPaywalls.m +48 -4
- package/ios/RNPurchases.m +1 -1
- package/package.json +1 -1
- package/scripts/docs/index.html +1 -1
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 '7.4.0-beta.
|
|
32
|
+
versionName '7.4.0-beta.3'
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
buildTypes {
|
|
@@ -121,7 +121,7 @@ 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:7.4.0-beta.
|
|
124
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:7.4.0-beta.3'
|
|
125
125
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
126
126
|
implementation 'androidx.compose.ui:ui-android:1.5.4'
|
|
127
127
|
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
@@ -45,7 +45,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
45
45
|
private static final String CUSTOMER_INFO_UPDATED = "Purchases-CustomerInfoUpdated";
|
|
46
46
|
private static final String LOG_HANDLER_EVENT = "Purchases-LogHandlerEvent";
|
|
47
47
|
public static final String PLATFORM_NAME = "react-native";
|
|
48
|
-
public static final String PLUGIN_VERSION = "7.4.0-beta.
|
|
48
|
+
public static final String PLUGIN_VERSION = "7.4.0-beta.3";
|
|
49
49
|
|
|
50
50
|
private final ReactApplicationContext reactContext;
|
|
51
51
|
|
package/ios/RNPaywallManager.m
CHANGED
|
@@ -17,9 +17,9 @@ RCT_EXPORT_MODULE(RNPaywall)
|
|
|
17
17
|
{
|
|
18
18
|
if (@available(iOS 15.0, *)) {
|
|
19
19
|
PaywallProxy *proxy = [[PaywallProxy alloc] init];
|
|
20
|
-
return proxy.
|
|
20
|
+
return [proxy createPaywallView].view;
|
|
21
21
|
} else {
|
|
22
|
-
|
|
22
|
+
NSLog(@"Error: attempted to present paywalls on unsupported iOS version.");
|
|
23
23
|
return nil;
|
|
24
24
|
}
|
|
25
25
|
}
|
package/ios/RNPaywalls.m
CHANGED
|
@@ -6,10 +6,44 @@
|
|
|
6
6
|
|
|
7
7
|
#import "RNPaywalls.h"
|
|
8
8
|
|
|
9
|
+
@interface RNPaywalls ()
|
|
10
|
+
|
|
11
|
+
@property (nonatomic, strong) id paywallProxy;
|
|
12
|
+
|
|
13
|
+
@end
|
|
14
|
+
|
|
9
15
|
@implementation RNPaywalls
|
|
10
16
|
|
|
11
17
|
RCT_EXPORT_MODULE();
|
|
12
18
|
|
|
19
|
+
- (instancetype)initWithDisabledObservation
|
|
20
|
+
{
|
|
21
|
+
if ((self = [super initWithDisabledObservation])) {
|
|
22
|
+
[self initializePaywalls];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return self;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (instancetype)init
|
|
29
|
+
{
|
|
30
|
+
if (([super init])) {
|
|
31
|
+
[self initializePaywalls];
|
|
32
|
+
}
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// `RCTEventEmitter` does not implement designated iniitializers correctly so we have to duplicate the call in both constructors.
|
|
37
|
+
- (void)initializePaywalls {
|
|
38
|
+
if (@available(iOS 15.0, *)) {
|
|
39
|
+
self.paywallProxy = [PaywallProxy new];
|
|
40
|
+
} else {
|
|
41
|
+
self.paywallProxy = nil;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// MARK: -
|
|
46
|
+
|
|
13
47
|
- (NSArray<NSString *> *)supportedEvents {
|
|
14
48
|
return @[];
|
|
15
49
|
}
|
|
@@ -18,20 +52,30 @@ RCT_EXPORT_MODULE();
|
|
|
18
52
|
return dispatch_get_main_queue();
|
|
19
53
|
}
|
|
20
54
|
|
|
55
|
+
- (PaywallProxy *)paywalls API_AVAILABLE(ios(15.0)){
|
|
56
|
+
return self.paywallProxy;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// MARK: -
|
|
60
|
+
|
|
21
61
|
RCT_EXPORT_METHOD(presentPaywall) {
|
|
22
62
|
if (@available(iOS 15.0, *)) {
|
|
23
|
-
[
|
|
63
|
+
[self.paywalls presentPaywall];
|
|
24
64
|
} else {
|
|
25
|
-
|
|
65
|
+
[self logPaywallsUnsupportedError];
|
|
26
66
|
}
|
|
27
67
|
}
|
|
28
68
|
|
|
29
69
|
RCT_EXPORT_METHOD(presentPaywallIfNeeded:(NSString *)requiredEntitlementIdentifier) {
|
|
30
70
|
if (@available(iOS 15.0, *)) {
|
|
31
|
-
[
|
|
71
|
+
[self.paywalls presentPaywallIfNeededWithRequiredEntitlementIdentifier:requiredEntitlementIdentifier];
|
|
32
72
|
} else {
|
|
33
|
-
|
|
73
|
+
[self logPaywallsUnsupportedError];
|
|
34
74
|
}
|
|
35
75
|
}
|
|
36
76
|
|
|
77
|
+
- (void)logPaywallsUnsupportedError {
|
|
78
|
+
NSLog(@"Error: attempted to present paywalls on unsupported iOS version.");
|
|
79
|
+
}
|
|
80
|
+
|
|
37
81
|
@end
|
package/ios/RNPurchases.m
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-purchases",
|
|
3
3
|
"title": "React Native Purchases",
|
|
4
|
-
"version": "7.4.0-beta.
|
|
4
|
+
"version": "7.4.0-beta.3",
|
|
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",
|
package/scripts/docs/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!DOCTYPE html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
|
-
<meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/7.4.0-beta.
|
|
5
|
+
<meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/7.4.0-beta.3/" />
|
|
6
6
|
</head>
|
|
7
7
|
<body>
|
|
8
8
|
</body>
|