react-native-purchases-ui 7.17.1 → 7.19.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/RNPaywalls.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/revenuecat/purchases/react/ui/BasePaywallViewManager.kt +25 -0
- package/android/src/main/java/com/revenuecat/purchases/react/ui/PaywallFooterViewManager.kt +8 -1
- package/android/src/main/java/com/revenuecat/purchases/react/ui/PaywallViewManager.kt +9 -1
- package/android/src/main/java/com/revenuecat/purchases/react/ui/RNPaywallsModule.kt +10 -1
- package/ios/PaywallViewManager.m +2 -0
- package/ios/PaywallViewWrapper.m +17 -2
- package/ios/RCPaywallFooterViewManager.m +7 -7
- package/ios/RNPaywalls.xcodeproj/project.pbxproj +329 -0
- package/lib/commonjs/index.js +11 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +11 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +19 -6
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +5 -3
- package/src/index.tsx +35 -11
package/RNPaywalls.podspec
CHANGED
@@ -17,6 +17,6 @@ Pod::Spec.new do |spec|
|
|
17
17
|
spec.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
|
18
18
|
|
19
19
|
spec.dependency "React-Core"
|
20
|
-
spec.dependency "PurchasesHybridCommonUI", '9.
|
20
|
+
spec.dependency "PurchasesHybridCommonUI", '9.6.0'
|
21
21
|
spec.swift_version = '5.7'
|
22
22
|
end
|
package/android/build.gradle
CHANGED
@@ -59,7 +59,7 @@ android {
|
|
59
59
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
60
60
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
61
61
|
versionCode 1
|
62
|
-
versionName '7.
|
62
|
+
versionName '7.19.0'
|
63
63
|
}
|
64
64
|
|
65
65
|
buildTypes {
|
@@ -91,7 +91,7 @@ dependencies {
|
|
91
91
|
//noinspection GradleDynamicVersion
|
92
92
|
implementation "com.facebook.react:react-native:+"
|
93
93
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
94
|
-
implementation 'com.revenuecat.purchases:purchases-hybrid-common-ui:9.
|
94
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common-ui:9.6.0'
|
95
95
|
implementation 'androidx.compose.ui:ui-android:1.5.4'
|
96
96
|
implementation "androidx.appcompat:appcompat:1.6.1"
|
97
97
|
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
package com.revenuecat.purchases.react.ui
|
2
|
+
|
3
|
+
import android.view.View
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
5
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
6
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
7
|
+
|
8
|
+
internal abstract class BasePaywallViewManager<T : View> : SimpleViewManager<T>() {
|
9
|
+
|
10
|
+
abstract fun setOfferingId(view: T, identifier: String)
|
11
|
+
|
12
|
+
@ReactProp(name = "options")
|
13
|
+
fun setOptions(view: T, options: ReadableMap?) {
|
14
|
+
options?.let { props ->
|
15
|
+
if (props.hasKey("offering")) {
|
16
|
+
props.getDynamic("offering").asMap()?.let { offeringMap ->
|
17
|
+
if (offeringMap.hasKey("identifier") && !offeringMap.isNull("identifier")) {
|
18
|
+
setOfferingId(view, offeringMap.getString("identifier")!!)
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
@@ -2,14 +2,17 @@ package com.revenuecat.purchases.react.ui
|
|
2
2
|
|
3
3
|
import android.annotation.SuppressLint
|
4
4
|
import androidx.core.view.children
|
5
|
+
import com.facebook.react.bridge.ReadableMap
|
5
6
|
import com.facebook.react.uimanager.SimpleViewManager
|
6
7
|
import com.facebook.react.uimanager.ThemedReactContext
|
7
8
|
import com.facebook.react.uimanager.UIManagerModule
|
9
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
8
10
|
import com.revenuecat.purchases.ui.revenuecatui.ExperimentalPreviewRevenueCatUIPurchasesAPI
|
9
11
|
import com.revenuecat.purchases.ui.revenuecatui.views.PaywallFooterView
|
10
12
|
|
11
13
|
@OptIn(ExperimentalPreviewRevenueCatUIPurchasesAPI::class)
|
12
|
-
internal class PaywallFooterViewManager :
|
14
|
+
internal class PaywallFooterViewManager : BasePaywallViewManager<PaywallFooterView>() {
|
15
|
+
|
13
16
|
override fun getName(): String {
|
14
17
|
return "RCPaywallFooterView"
|
15
18
|
}
|
@@ -61,4 +64,8 @@ internal class PaywallFooterViewManager : SimpleViewManager<PaywallFooterView>()
|
|
61
64
|
return paywallFooterView
|
62
65
|
}
|
63
66
|
|
67
|
+
override fun setOfferingId(view: PaywallFooterView, identifier: String) {
|
68
|
+
view.setOfferingId(identifier)
|
69
|
+
}
|
70
|
+
|
64
71
|
}
|
@@ -1,12 +1,15 @@
|
|
1
1
|
package com.revenuecat.purchases.react.ui
|
2
2
|
|
3
|
+
import com.facebook.react.bridge.ReadableMap
|
3
4
|
import com.facebook.react.uimanager.SimpleViewManager
|
4
5
|
import com.facebook.react.uimanager.ThemedReactContext
|
6
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
5
7
|
import com.revenuecat.purchases.ui.revenuecatui.ExperimentalPreviewRevenueCatUIPurchasesAPI
|
6
8
|
import com.revenuecat.purchases.ui.revenuecatui.views.PaywallView
|
7
9
|
|
8
10
|
@OptIn(ExperimentalPreviewRevenueCatUIPurchasesAPI::class)
|
9
|
-
internal class PaywallViewManager :
|
11
|
+
internal class PaywallViewManager : BasePaywallViewManager<PaywallView>() {
|
12
|
+
|
10
13
|
companion object {
|
11
14
|
const val REACT_CLASS = "Paywall"
|
12
15
|
}
|
@@ -22,4 +25,9 @@ internal class PaywallViewManager : SimpleViewManager<PaywallView>() {
|
|
22
25
|
override fun createShadowNodeInstance(): PaywallViewShadowNode {
|
23
26
|
return PaywallViewShadowNode()
|
24
27
|
}
|
28
|
+
|
29
|
+
override fun setOfferingId(view: PaywallView, identifier: String) {
|
30
|
+
view.setOfferingId(identifier)
|
31
|
+
}
|
32
|
+
|
25
33
|
}
|
@@ -6,7 +6,6 @@ import com.facebook.react.bridge.Promise
|
|
6
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
7
7
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
8
8
|
import com.facebook.react.bridge.ReactMethod
|
9
|
-
import com.facebook.react.bridge.ReadableMap
|
10
9
|
import com.revenuecat.purchases.hybridcommon.ui.PaywallResultListener
|
11
10
|
import com.revenuecat.purchases.hybridcommon.ui.PaywallSource
|
12
11
|
import com.revenuecat.purchases.hybridcommon.ui.PresentPaywallOptions
|
@@ -62,6 +61,16 @@ internal class RNPaywallsModule(reactContext: ReactApplicationContext) :
|
|
62
61
|
)
|
63
62
|
}
|
64
63
|
|
64
|
+
@ReactMethod
|
65
|
+
fun addListener(eventName: String?) {
|
66
|
+
// Keep: Required for RN built in Event Emitter Calls.
|
67
|
+
}
|
68
|
+
|
69
|
+
@ReactMethod
|
70
|
+
fun removeListeners(count: Int?) {
|
71
|
+
// Keep: Required for RN built in Event Emitter Calls.
|
72
|
+
}
|
73
|
+
|
65
74
|
private fun presentPaywall(
|
66
75
|
requiredEntitlementIdentifier: String?,
|
67
76
|
offeringIdentifier: String?,
|
package/ios/PaywallViewManager.m
CHANGED
package/ios/PaywallViewWrapper.m
CHANGED
@@ -12,9 +12,10 @@
|
|
12
12
|
@import PurchasesHybridCommonUI;
|
13
13
|
@import RevenueCatUI;
|
14
14
|
|
15
|
+
API_AVAILABLE(ios(15.0))
|
15
16
|
@interface PaywallViewWrapper () <RCPaywallViewControllerDelegate>
|
16
17
|
|
17
|
-
@property (strong, nonatomic)
|
18
|
+
@property (strong, nonatomic) RCPaywallViewController *paywallViewController;
|
18
19
|
|
19
20
|
@property (nonatomic) BOOL addedToHierarchy;
|
20
21
|
|
@@ -22,7 +23,7 @@
|
|
22
23
|
|
23
24
|
@implementation PaywallViewWrapper
|
24
25
|
|
25
|
-
- (instancetype)initWithPaywallViewController:(
|
26
|
+
- (instancetype)initWithPaywallViewController:(RCPaywallViewController *)paywallViewController API_AVAILABLE(ios(15.0)){
|
26
27
|
NSParameterAssert(paywallViewController);
|
27
28
|
|
28
29
|
if ((self = [super initWithFrame:paywallViewController.view.bounds])) {
|
@@ -58,4 +59,18 @@
|
|
58
59
|
}
|
59
60
|
}
|
60
61
|
|
62
|
+
- (void)setOptions:(NSDictionary *)options {
|
63
|
+
if (@available(iOS 15.0, *)) {
|
64
|
+
NSDictionary *offering = options[@"offering"];
|
65
|
+
if (offering && ![offering isKindOfClass:[NSNull class]]) {
|
66
|
+
NSString *identifier = offering[@"identifier"];
|
67
|
+
if (identifier) {
|
68
|
+
[self.paywallViewController updateWithOfferingIdentifier:identifier];
|
69
|
+
}
|
70
|
+
}
|
71
|
+
} else {
|
72
|
+
NSLog(@"Error: attempted to present paywalls on unsupported iOS version.");
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
61
76
|
@end
|
@@ -24,8 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
24
24
|
|
25
25
|
@interface FooterViewWrapper: PaywallViewWrapper
|
26
26
|
|
27
|
-
- (instancetype)
|
28
|
-
|
27
|
+
- (instancetype)initWithPaywallViewController:(UIViewController *)footerViewController
|
28
|
+
bridge:(RCTBridge *)bridge;
|
29
29
|
|
30
30
|
@end
|
31
31
|
|
@@ -35,13 +35,11 @@ NS_ASSUME_NONNULL_END
|
|
35
35
|
|
36
36
|
@property (strong, nonatomic) RCTBridge *bridge;
|
37
37
|
|
38
|
-
@property BOOL addedToHierarchy;
|
39
|
-
|
40
38
|
@end
|
41
39
|
|
42
40
|
@implementation FooterViewWrapper
|
43
41
|
|
44
|
-
- (instancetype)
|
42
|
+
- (instancetype)initWithPaywallViewController:(UIViewController *)footerViewController bridge:(RCTBridge *)bridge {
|
45
43
|
if ((self = [super initWithPaywallViewController:footerViewController])) {
|
46
44
|
_bridge = bridge;
|
47
45
|
}
|
@@ -81,6 +79,8 @@ NS_ASSUME_NONNULL_END
|
|
81
79
|
|
82
80
|
@implementation RCPaywallFooterViewManager
|
83
81
|
|
82
|
+
RCT_EXPORT_VIEW_PROPERTY(options, NSDictionary);
|
83
|
+
|
84
84
|
RCT_EXPORT_MODULE(RCPaywallFooterView)
|
85
85
|
|
86
86
|
- (instancetype)init {
|
@@ -101,8 +101,8 @@ RCT_EXPORT_MODULE(RCPaywallFooterView)
|
|
101
101
|
{
|
102
102
|
if (@available(iOS 15.0, *)) {
|
103
103
|
UIViewController *footerViewController = [self.proxy createFooterPaywallView];
|
104
|
-
FooterViewWrapper *wrapper = [[FooterViewWrapper alloc]
|
105
|
-
|
104
|
+
FooterViewWrapper *wrapper = [[FooterViewWrapper alloc] initWithPaywallViewController:footerViewController
|
105
|
+
bridge:self.bridge];
|
106
106
|
self.proxy.delegate = wrapper;
|
107
107
|
|
108
108
|
return wrapper;
|
@@ -0,0 +1,329 @@
|
|
1
|
+
// !$*UTF8*$!
|
2
|
+
{
|
3
|
+
archiveVersion = 1;
|
4
|
+
classes = {
|
5
|
+
};
|
6
|
+
objectVersion = 56;
|
7
|
+
objects = {
|
8
|
+
|
9
|
+
/* Begin PBXBuildFile section */
|
10
|
+
354FF7CC2B6423CB0050DDFD /* PaywallViewWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 354FF7C12B6423CB0050DDFD /* PaywallViewWrapper.m */; };
|
11
|
+
354FF7CD2B6423CB0050DDFD /* RNPaywalls.m in Sources */ = {isa = PBXBuildFile; fileRef = 354FF7C22B6423CB0050DDFD /* RNPaywalls.m */; };
|
12
|
+
354FF7CE2B6423CB0050DDFD /* RCPaywallFooterViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 354FF7C62B6423CB0050DDFD /* RCPaywallFooterViewManager.m */; };
|
13
|
+
354FF7CF2B6423CB0050DDFD /* PaywallViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 354FF7C72B6423CB0050DDFD /* PaywallViewManager.m */; };
|
14
|
+
354FF7D02B6423CB0050DDFD /* PurchasesPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 354FF7C92B6423CB0050DDFD /* PurchasesPlugin.swift */; };
|
15
|
+
354FF7D12B6423CB0050DDFD /* UIView+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 354FF7CA2B6423CB0050DDFD /* UIView+Extensions.m */; };
|
16
|
+
/* End PBXBuildFile section */
|
17
|
+
|
18
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
19
|
+
354FF7B32B6422970050DDFD /* CopyFiles */ = {
|
20
|
+
isa = PBXCopyFilesBuildPhase;
|
21
|
+
buildActionMask = 2147483647;
|
22
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
23
|
+
dstSubfolderSpec = 16;
|
24
|
+
files = (
|
25
|
+
);
|
26
|
+
runOnlyForDeploymentPostprocessing = 0;
|
27
|
+
};
|
28
|
+
/* End PBXCopyFilesBuildPhase section */
|
29
|
+
|
30
|
+
/* Begin PBXFileReference section */
|
31
|
+
354FF7B52B6422970050DDFD /* libRNPaywalls.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNPaywalls.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
32
|
+
354FF7BF2B6423CA0050DDFD /* RNPaywalls-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNPaywalls-Bridging-Header.h"; sourceTree = "<group>"; };
|
33
|
+
354FF7C02B6423CB0050DDFD /* RNPaywalls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPaywalls.h; sourceTree = "<group>"; };
|
34
|
+
354FF7C12B6423CB0050DDFD /* PaywallViewWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaywallViewWrapper.m; sourceTree = "<group>"; };
|
35
|
+
354FF7C22B6423CB0050DDFD /* RNPaywalls.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPaywalls.m; sourceTree = "<group>"; };
|
36
|
+
354FF7C32B6423CB0050DDFD /* RNPaywalls-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RNPaywalls-Bridging-Header.h"; sourceTree = "<group>"; };
|
37
|
+
354FF7C42B6423CB0050DDFD /* PaywallViewWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaywallViewWrapper.h; sourceTree = "<group>"; };
|
38
|
+
354FF7C52B6423CB0050DDFD /* RCPaywallFooterViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCPaywallFooterViewManager.h; sourceTree = "<group>"; };
|
39
|
+
354FF7C62B6423CB0050DDFD /* RCPaywallFooterViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCPaywallFooterViewManager.m; sourceTree = "<group>"; };
|
40
|
+
354FF7C72B6423CB0050DDFD /* PaywallViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaywallViewManager.m; sourceTree = "<group>"; };
|
41
|
+
354FF7C82B6423CB0050DDFD /* UIView+Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extensions.h"; sourceTree = "<group>"; };
|
42
|
+
354FF7C92B6423CB0050DDFD /* PurchasesPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PurchasesPlugin.swift; sourceTree = "<group>"; };
|
43
|
+
354FF7CA2B6423CB0050DDFD /* UIView+Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extensions.m"; sourceTree = "<group>"; };
|
44
|
+
354FF7CB2B6423CB0050DDFD /* PaywallViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaywallViewManager.h; sourceTree = "<group>"; };
|
45
|
+
/* End PBXFileReference section */
|
46
|
+
|
47
|
+
/* Begin PBXFrameworksBuildPhase section */
|
48
|
+
354FF7B22B6422970050DDFD /* Frameworks */ = {
|
49
|
+
isa = PBXFrameworksBuildPhase;
|
50
|
+
buildActionMask = 2147483647;
|
51
|
+
files = (
|
52
|
+
);
|
53
|
+
runOnlyForDeploymentPostprocessing = 0;
|
54
|
+
};
|
55
|
+
/* End PBXFrameworksBuildPhase section */
|
56
|
+
|
57
|
+
/* Begin PBXGroup section */
|
58
|
+
354FF7AC2B6422970050DDFD = {
|
59
|
+
isa = PBXGroup;
|
60
|
+
children = (
|
61
|
+
354FF7CB2B6423CB0050DDFD /* PaywallViewManager.h */,
|
62
|
+
354FF7C72B6423CB0050DDFD /* PaywallViewManager.m */,
|
63
|
+
354FF7C42B6423CB0050DDFD /* PaywallViewWrapper.h */,
|
64
|
+
354FF7C12B6423CB0050DDFD /* PaywallViewWrapper.m */,
|
65
|
+
354FF7C92B6423CB0050DDFD /* PurchasesPlugin.swift */,
|
66
|
+
354FF7C52B6423CB0050DDFD /* RCPaywallFooterViewManager.h */,
|
67
|
+
354FF7C62B6423CB0050DDFD /* RCPaywallFooterViewManager.m */,
|
68
|
+
354FF7C32B6423CB0050DDFD /* RNPaywalls-Bridging-Header.h */,
|
69
|
+
354FF7C02B6423CB0050DDFD /* RNPaywalls.h */,
|
70
|
+
354FF7C22B6423CB0050DDFD /* RNPaywalls.m */,
|
71
|
+
354FF7C82B6423CB0050DDFD /* UIView+Extensions.h */,
|
72
|
+
354FF7CA2B6423CB0050DDFD /* UIView+Extensions.m */,
|
73
|
+
354FF7B62B6422970050DDFD /* Products */,
|
74
|
+
354FF7BF2B6423CA0050DDFD /* RNPaywalls-Bridging-Header.h */,
|
75
|
+
);
|
76
|
+
sourceTree = "<group>";
|
77
|
+
};
|
78
|
+
354FF7B62B6422970050DDFD /* Products */ = {
|
79
|
+
isa = PBXGroup;
|
80
|
+
children = (
|
81
|
+
354FF7B52B6422970050DDFD /* libRNPaywalls.a */,
|
82
|
+
);
|
83
|
+
name = Products;
|
84
|
+
sourceTree = "<group>";
|
85
|
+
};
|
86
|
+
/* End PBXGroup section */
|
87
|
+
|
88
|
+
/* Begin PBXNativeTarget section */
|
89
|
+
354FF7B42B6422970050DDFD /* RNPaywalls */ = {
|
90
|
+
isa = PBXNativeTarget;
|
91
|
+
buildConfigurationList = 354FF7BC2B6422970050DDFD /* Build configuration list for PBXNativeTarget "RNPaywalls" */;
|
92
|
+
buildPhases = (
|
93
|
+
354FF7B12B6422970050DDFD /* Sources */,
|
94
|
+
354FF7B22B6422970050DDFD /* Frameworks */,
|
95
|
+
354FF7B32B6422970050DDFD /* CopyFiles */,
|
96
|
+
);
|
97
|
+
buildRules = (
|
98
|
+
);
|
99
|
+
dependencies = (
|
100
|
+
);
|
101
|
+
name = RNPaywalls;
|
102
|
+
productName = RNPaywalls;
|
103
|
+
productReference = 354FF7B52B6422970050DDFD /* libRNPaywalls.a */;
|
104
|
+
productType = "com.apple.product-type.library.static";
|
105
|
+
};
|
106
|
+
/* End PBXNativeTarget section */
|
107
|
+
|
108
|
+
/* Begin PBXProject section */
|
109
|
+
354FF7AD2B6422970050DDFD /* Project object */ = {
|
110
|
+
isa = PBXProject;
|
111
|
+
attributes = {
|
112
|
+
BuildIndependentTargetsInParallel = NO;
|
113
|
+
LastSwiftUpdateCheck = 1520;
|
114
|
+
LastUpgradeCheck = 1520;
|
115
|
+
TargetAttributes = {
|
116
|
+
354FF7B42B6422970050DDFD = {
|
117
|
+
CreatedOnToolsVersion = 15.2;
|
118
|
+
LastSwiftMigration = 1520;
|
119
|
+
};
|
120
|
+
};
|
121
|
+
};
|
122
|
+
buildConfigurationList = 354FF7B02B6422970050DDFD /* Build configuration list for PBXProject "RNPaywalls" */;
|
123
|
+
compatibilityVersion = "Xcode 14.0";
|
124
|
+
developmentRegion = en;
|
125
|
+
hasScannedForEncodings = 0;
|
126
|
+
knownRegions = (
|
127
|
+
en,
|
128
|
+
Base,
|
129
|
+
);
|
130
|
+
mainGroup = 354FF7AC2B6422970050DDFD;
|
131
|
+
productRefGroup = 354FF7B62B6422970050DDFD /* Products */;
|
132
|
+
projectDirPath = "";
|
133
|
+
projectRoot = "";
|
134
|
+
targets = (
|
135
|
+
354FF7B42B6422970050DDFD /* RNPaywalls */,
|
136
|
+
);
|
137
|
+
};
|
138
|
+
/* End PBXProject section */
|
139
|
+
|
140
|
+
/* Begin PBXSourcesBuildPhase section */
|
141
|
+
354FF7B12B6422970050DDFD /* Sources */ = {
|
142
|
+
isa = PBXSourcesBuildPhase;
|
143
|
+
buildActionMask = 2147483647;
|
144
|
+
files = (
|
145
|
+
354FF7CE2B6423CB0050DDFD /* RCPaywallFooterViewManager.m in Sources */,
|
146
|
+
354FF7CD2B6423CB0050DDFD /* RNPaywalls.m in Sources */,
|
147
|
+
354FF7CC2B6423CB0050DDFD /* PaywallViewWrapper.m in Sources */,
|
148
|
+
354FF7D02B6423CB0050DDFD /* PurchasesPlugin.swift in Sources */,
|
149
|
+
354FF7D12B6423CB0050DDFD /* UIView+Extensions.m in Sources */,
|
150
|
+
354FF7CF2B6423CB0050DDFD /* PaywallViewManager.m in Sources */,
|
151
|
+
);
|
152
|
+
runOnlyForDeploymentPostprocessing = 0;
|
153
|
+
};
|
154
|
+
/* End PBXSourcesBuildPhase section */
|
155
|
+
|
156
|
+
/* Begin XCBuildConfiguration section */
|
157
|
+
354FF7BA2B6422970050DDFD /* Debug */ = {
|
158
|
+
isa = XCBuildConfiguration;
|
159
|
+
buildSettings = {
|
160
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
161
|
+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
162
|
+
CLANG_ANALYZER_NONNULL = YES;
|
163
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
164
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
165
|
+
CLANG_ENABLE_MODULES = YES;
|
166
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
167
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
168
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
169
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
170
|
+
CLANG_WARN_COMMA = YES;
|
171
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
172
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
173
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
174
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
175
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
176
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
177
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
178
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
179
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
180
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
181
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
182
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
183
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
184
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
185
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
186
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
187
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
188
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
189
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
190
|
+
COPY_PHASE_STRIP = NO;
|
191
|
+
DEBUG_INFORMATION_FORMAT = dwarf;
|
192
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
193
|
+
ENABLE_TESTABILITY = YES;
|
194
|
+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
195
|
+
GCC_C_LANGUAGE_STANDARD = gnu17;
|
196
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
197
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
198
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
199
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
200
|
+
"DEBUG=1",
|
201
|
+
"$(inherited)",
|
202
|
+
);
|
203
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
204
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
205
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
206
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
207
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
208
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
209
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
210
|
+
LOCALIZATION_PREFERS_STRING_CATALOGS = NO;
|
211
|
+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
212
|
+
MTL_FAST_MATH = YES;
|
213
|
+
ONLY_ACTIVE_ARCH = YES;
|
214
|
+
SDKROOT = iphoneos;
|
215
|
+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
|
216
|
+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
217
|
+
};
|
218
|
+
name = Debug;
|
219
|
+
};
|
220
|
+
354FF7BB2B6422970050DDFD /* Release */ = {
|
221
|
+
isa = XCBuildConfiguration;
|
222
|
+
buildSettings = {
|
223
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
224
|
+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
225
|
+
CLANG_ANALYZER_NONNULL = YES;
|
226
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
227
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
228
|
+
CLANG_ENABLE_MODULES = YES;
|
229
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
230
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
231
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
232
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
233
|
+
CLANG_WARN_COMMA = YES;
|
234
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
235
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
236
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
237
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
238
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
239
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
240
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
241
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
242
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
243
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
244
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
245
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
246
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
247
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
248
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
249
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
250
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
251
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
252
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
253
|
+
COPY_PHASE_STRIP = YES;
|
254
|
+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
255
|
+
ENABLE_NS_ASSERTIONS = NO;
|
256
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
257
|
+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
258
|
+
GCC_C_LANGUAGE_STANDARD = gnu17;
|
259
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
260
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
261
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
262
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
263
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
264
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
265
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
266
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
267
|
+
LOCALIZATION_PREFERS_STRING_CATALOGS = NO;
|
268
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
269
|
+
MTL_FAST_MATH = YES;
|
270
|
+
SDKROOT = iphoneos;
|
271
|
+
SWIFT_COMPILATION_MODE = wholemodule;
|
272
|
+
VALIDATE_PRODUCT = YES;
|
273
|
+
};
|
274
|
+
name = Release;
|
275
|
+
};
|
276
|
+
354FF7BD2B6422970050DDFD /* Debug */ = {
|
277
|
+
isa = XCBuildConfiguration;
|
278
|
+
buildSettings = {
|
279
|
+
CLANG_ENABLE_MODULES = YES;
|
280
|
+
CODE_SIGN_STYLE = Automatic;
|
281
|
+
OTHER_LDFLAGS = "-ObjC";
|
282
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
283
|
+
SKIP_INSTALL = YES;
|
284
|
+
SWIFT_OBJC_BRIDGING_HEADER = "RNPaywalls-Bridging-Header.h";
|
285
|
+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
286
|
+
SWIFT_VERSION = 5.0;
|
287
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
288
|
+
};
|
289
|
+
name = Debug;
|
290
|
+
};
|
291
|
+
354FF7BE2B6422970050DDFD /* Release */ = {
|
292
|
+
isa = XCBuildConfiguration;
|
293
|
+
buildSettings = {
|
294
|
+
CLANG_ENABLE_MODULES = YES;
|
295
|
+
CODE_SIGN_STYLE = Automatic;
|
296
|
+
OTHER_LDFLAGS = "-ObjC";
|
297
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
298
|
+
SKIP_INSTALL = YES;
|
299
|
+
SWIFT_OBJC_BRIDGING_HEADER = "RNPaywalls-Bridging-Header.h";
|
300
|
+
SWIFT_VERSION = 5.0;
|
301
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
302
|
+
};
|
303
|
+
name = Release;
|
304
|
+
};
|
305
|
+
/* End XCBuildConfiguration section */
|
306
|
+
|
307
|
+
/* Begin XCConfigurationList section */
|
308
|
+
354FF7B02B6422970050DDFD /* Build configuration list for PBXProject "RNPaywalls" */ = {
|
309
|
+
isa = XCConfigurationList;
|
310
|
+
buildConfigurations = (
|
311
|
+
354FF7BA2B6422970050DDFD /* Debug */,
|
312
|
+
354FF7BB2B6422970050DDFD /* Release */,
|
313
|
+
);
|
314
|
+
defaultConfigurationIsVisible = 0;
|
315
|
+
defaultConfigurationName = Release;
|
316
|
+
};
|
317
|
+
354FF7BC2B6422970050DDFD /* Build configuration list for PBXNativeTarget "RNPaywalls" */ = {
|
318
|
+
isa = XCConfigurationList;
|
319
|
+
buildConfigurations = (
|
320
|
+
354FF7BD2B6422970050DDFD /* Debug */,
|
321
|
+
354FF7BE2B6422970050DDFD /* Release */,
|
322
|
+
);
|
323
|
+
defaultConfigurationIsVisible = 0;
|
324
|
+
defaultConfigurationName = Release;
|
325
|
+
};
|
326
|
+
/* End XCConfigurationList section */
|
327
|
+
};
|
328
|
+
rootObject = 354FF7AD2B6422970050DDFD /* Project object */;
|
329
|
+
}
|
package/lib/commonjs/index.js
CHANGED
@@ -16,11 +16,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
18
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
|
-
const LINKING_ERROR = `The package 'react-native-purchases-
|
19
|
+
const LINKING_ERROR = `The package 'react-native-purchases-ui' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
20
20
|
ios: "- You have run 'pod install'\n",
|
21
21
|
default: ''
|
22
22
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
23
23
|
const RNPaywalls = _reactNative.NativeModules.RNPaywalls;
|
24
|
+
if (!RNPaywalls) {
|
25
|
+
throw new Error(LINKING_ERROR);
|
26
|
+
}
|
24
27
|
const eventEmitter = new _reactNative.NativeEventEmitter(RNPaywalls);
|
25
28
|
const InternalPaywall = _reactNative.UIManager.getViewManagerConfig('Paywall') != null ? (0, _reactNative.requireNativeComponent)('Paywall') : () => {
|
26
29
|
throw new Error(LINKING_ERROR);
|
@@ -28,6 +31,9 @@ const InternalPaywall = _reactNative.UIManager.getViewManagerConfig('Paywall') !
|
|
28
31
|
const InternalPaywallFooterView = _reactNative.UIManager.getViewManagerConfig('Paywall') != null ? (0, _reactNative.requireNativeComponent)('RCPaywallFooterView') : () => {
|
29
32
|
throw new Error(LINKING_ERROR);
|
30
33
|
};
|
34
|
+
|
35
|
+
// Currently the same as the base type, but can be extended later if needed
|
36
|
+
|
31
37
|
class RevenueCatUI {
|
32
38
|
static Defaults = {
|
33
39
|
PRESENT_PAYWALL_DISPLAY_CLOSE_BUTTON: true
|
@@ -84,7 +90,8 @@ class RevenueCatUI {
|
|
84
90
|
}));
|
85
91
|
static PaywallFooterContainerView = ({
|
86
92
|
style,
|
87
|
-
children
|
93
|
+
children,
|
94
|
+
options
|
88
95
|
}) => {
|
89
96
|
// We use 20 as the default paddingBottom because that's the corner radius in the Android native SDK.
|
90
97
|
// We also listen to safeAreaInsetsDidChange which is only sent from iOS and which is triggered when the
|
@@ -114,7 +121,8 @@ class RevenueCatUI {
|
|
114
121
|
}, children), /*#__PURE__*/_react.default.createElement(InternalPaywallFooterView, {
|
115
122
|
style: {
|
116
123
|
marginTop: -20
|
117
|
-
}
|
124
|
+
},
|
125
|
+
options: options
|
118
126
|
}));
|
119
127
|
};
|
120
128
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_purchasesTypescriptInternal","_react","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","LINKING_ERROR","Platform","select","ios","RNPaywalls","NativeModules","eventEmitter","NativeEventEmitter","InternalPaywall","UIManager","getViewManagerConfig","requireNativeComponent","
|
1
|
+
{"version":3,"names":["_reactNative","require","_purchasesTypescriptInternal","_react","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","LINKING_ERROR","Platform","select","ios","RNPaywalls","NativeModules","Error","eventEmitter","NativeEventEmitter","InternalPaywall","UIManager","getViewManagerConfig","requireNativeComponent","InternalPaywallFooterView","RevenueCatUI","Defaults","PRESENT_PAYWALL_DISPLAY_CLOSE_BUTTON","PAYWALL_RESULT","presentPaywall","offering","displayCloseButton","identifier","presentPaywallIfNeeded","requiredEntitlementIdentifier","Paywall","props","createElement","style","flex","PaywallFooterContainerView","children","options","paddingBottom","setPaddingBottom","useState","useEffect","handleSafeAreaInsetsChange","bottom","subscription","addListener","remove","View","ScrollView","contentContainerStyle","flexGrow","marginTop","exports"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAWA,IAAAC,4BAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAmE,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,M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,OAAO,EAAEA;IAAQ,CAAC,CAClE,CAAC;EAEX,CAAC;AACH;AAACe,OAAA,CAAAtE,OAAA,GAAAsC,YAAA"}
|
package/lib/module/index.js
CHANGED
@@ -3,11 +3,14 @@ import { NativeEventEmitter, NativeModules, Platform, requireNativeComponent, Sc
|
|
3
3
|
import { PAYWALL_RESULT } from "@revenuecat/purchases-typescript-internal";
|
4
4
|
import React, { useEffect, useState } from "react";
|
5
5
|
export { PAYWALL_RESULT } from "@revenuecat/purchases-typescript-internal";
|
6
|
-
const LINKING_ERROR = `The package 'react-native-purchases-
|
6
|
+
const LINKING_ERROR = `The package 'react-native-purchases-ui' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
7
7
|
ios: "- You have run 'pod install'\n",
|
8
8
|
default: ''
|
9
9
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
10
10
|
const RNPaywalls = NativeModules.RNPaywalls;
|
11
|
+
if (!RNPaywalls) {
|
12
|
+
throw new Error(LINKING_ERROR);
|
13
|
+
}
|
11
14
|
const eventEmitter = new NativeEventEmitter(RNPaywalls);
|
12
15
|
const InternalPaywall = UIManager.getViewManagerConfig('Paywall') != null ? requireNativeComponent('Paywall') : () => {
|
13
16
|
throw new Error(LINKING_ERROR);
|
@@ -15,6 +18,9 @@ const InternalPaywall = UIManager.getViewManagerConfig('Paywall') != null ? requ
|
|
15
18
|
const InternalPaywallFooterView = UIManager.getViewManagerConfig('Paywall') != null ? requireNativeComponent('RCPaywallFooterView') : () => {
|
16
19
|
throw new Error(LINKING_ERROR);
|
17
20
|
};
|
21
|
+
|
22
|
+
// Currently the same as the base type, but can be extended later if needed
|
23
|
+
|
18
24
|
export default class RevenueCatUI {
|
19
25
|
static Defaults = {
|
20
26
|
PRESENT_PAYWALL_DISPLAY_CLOSE_BUTTON: true
|
@@ -71,7 +77,8 @@ export default class RevenueCatUI {
|
|
71
77
|
}));
|
72
78
|
static PaywallFooterContainerView = ({
|
73
79
|
style,
|
74
|
-
children
|
80
|
+
children,
|
81
|
+
options
|
75
82
|
}) => {
|
76
83
|
// We use 20 as the default paddingBottom because that's the corner radius in the Android native SDK.
|
77
84
|
// We also listen to safeAreaInsetsDidChange which is only sent from iOS and which is triggered when the
|
@@ -101,7 +108,8 @@ export default class RevenueCatUI {
|
|
101
108
|
}, children), /*#__PURE__*/React.createElement(InternalPaywallFooterView, {
|
102
109
|
style: {
|
103
110
|
marginTop: -20
|
104
|
-
}
|
111
|
+
},
|
112
|
+
options: options
|
105
113
|
}));
|
106
114
|
};
|
107
115
|
}
|
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","Platform","requireNativeComponent","ScrollView","UIManager","View","PAYWALL_RESULT","React","useEffect","useState","LINKING_ERROR","select","ios","default","RNPaywalls","eventEmitter","InternalPaywall","getViewManagerConfig","
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","Platform","requireNativeComponent","ScrollView","UIManager","View","PAYWALL_RESULT","React","useEffect","useState","LINKING_ERROR","select","ios","default","RNPaywalls","Error","eventEmitter","InternalPaywall","getViewManagerConfig","InternalPaywallFooterView","RevenueCatUI","Defaults","PRESENT_PAYWALL_DISPLAY_CLOSE_BUTTON","presentPaywall","offering","displayCloseButton","identifier","presentPaywallIfNeeded","requiredEntitlementIdentifier","Paywall","props","createElement","_extends","style","flex","PaywallFooterContainerView","children","options","paddingBottom","setPaddingBottom","handleSafeAreaInsetsChange","bottom","subscription","addListener","remove","contentContainerStyle","flexGrow","marginTop"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";AAAA,SACEA,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,EACRC,sBAAsB,EACtBC,UAAU,EAEVC,SAAS,EACTC,IAAI,QAEC,cAAc;AACrB,SAASC,cAAc,QAAgC,2CAA2C;AAClG,OAAOC,KAAK,IAAoBC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAElE,SAASH,cAAc,QA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AAER;MAAa;IAAE,GAC7DF,QACS,CAAC,eAEb7B,KAAA,CAAAwB,aAAA,CAACZ,yBAAyB;MAACc,KAAK,EAAE;QAACc,SAAS,EAAE,CAAC;MAAE,CAAE;MAACV,OAAO,EAAEA;IAAQ,CAAC,CAClE,CAAC;EAEX,CAAC;AACH"}
|
@@ -2,10 +2,6 @@ import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
2
|
import { PAYWALL_RESULT, type PurchasesOffering } from "@revenuecat/purchases-typescript-internal";
|
3
3
|
import React, { type ReactNode } from "react";
|
4
4
|
export { PAYWALL_RESULT } from "@revenuecat/purchases-typescript-internal";
|
5
|
-
type PaywallViewProps = {
|
6
|
-
style?: StyleProp<ViewStyle>;
|
7
|
-
children?: ReactNode;
|
8
|
-
};
|
9
5
|
export interface PresentPaywallParams {
|
10
6
|
/**
|
11
7
|
* Whether to display the close button or not.
|
@@ -22,6 +18,23 @@ export type PresentPaywallIfNeededParams = PresentPaywallParams & {
|
|
22
18
|
*/
|
23
19
|
requiredEntitlementIdentifier: string;
|
24
20
|
};
|
21
|
+
export interface PaywallViewOptions {
|
22
|
+
offering?: PurchasesOffering | null;
|
23
|
+
}
|
24
|
+
export interface FullScreenPaywallViewOptions extends PaywallViewOptions {
|
25
|
+
}
|
26
|
+
export interface FooterPaywallViewOptions extends PaywallViewOptions {
|
27
|
+
}
|
28
|
+
type FullScreenPaywallViewProps = {
|
29
|
+
style?: StyleProp<ViewStyle>;
|
30
|
+
children?: ReactNode;
|
31
|
+
options?: FullScreenPaywallViewOptions;
|
32
|
+
};
|
33
|
+
type FooterPaywallViewProps = {
|
34
|
+
style?: StyleProp<ViewStyle>;
|
35
|
+
children?: ReactNode;
|
36
|
+
options?: FooterPaywallViewOptions;
|
37
|
+
};
|
25
38
|
export default class RevenueCatUI {
|
26
39
|
private static Defaults;
|
27
40
|
/**
|
@@ -55,7 +68,7 @@ export default class RevenueCatUI {
|
|
55
68
|
* @returns {Promise<PAYWALL_RESULT>} A promise that resolves with the result of the paywall presentation.
|
56
69
|
*/
|
57
70
|
static presentPaywallIfNeeded({ requiredEntitlementIdentifier, offering, displayCloseButton }: PresentPaywallIfNeededParams): Promise<PAYWALL_RESULT>;
|
58
|
-
static Paywall: React.FC<
|
59
|
-
static PaywallFooterContainerView: React.FC<
|
71
|
+
static Paywall: React.FC<FullScreenPaywallViewProps>;
|
72
|
+
static PaywallFooterContainerView: React.FC<FooterPaywallViewProps>;
|
60
73
|
}
|
61
74
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AA6B3E,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,MAAM,MAAM,4BAA4B,GAAG,oBAAoB,GAAG;IAChE;;OAEG;IACH,6BAA6B,EAAE,MAAM,CAAC;CACvC,CAAA;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;CAEvE;AAGD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;CAEnE;AAED,KAAK,0BAA0B,GAAG;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,4BAA4B,CAAC;CACxC,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,YAAY;IAE/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAEtB;IAED;;;;OAIG;IACH,OAAc,cAAc,wBAAkB;IAE9C;;;;;;;;;OASG;WACW,cAAc,CAAC,EACE,QAAQ,EACR,kBAA+E,EAChF,GAAE,oBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC;IAInF;;;;;;;;;;;;OAYG;WACW,sBAAsB,CAAC,EACE,6BAA6B,EAC7B,QAAQ,EACR,kBAA+E,EAChF,EAAE,4BAA4B,GAAG,OAAO,CAAC,cAAc,CAAC;IAI9F,OAAc,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAEzD;IAEF,OAAc,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAmCxE;CACH"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-purchases-ui",
|
3
3
|
"title": "React Native Purchases UI",
|
4
|
-
"version": "7.
|
4
|
+
"version": "7.19.0",
|
5
5
|
"description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android.",
|
6
6
|
"main": "lib/commonjs/index",
|
7
7
|
"module": "lib/module/index",
|
@@ -18,9 +18,11 @@
|
|
18
18
|
"!android/gradlew.bat",
|
19
19
|
"!android/local.properties",
|
20
20
|
"ios",
|
21
|
+
"!ios/build",
|
22
|
+
"!ios/RNPaywalls.xcodeproj/project.xcworkspace",
|
23
|
+
"!ios/RNPaywalls.xcodeproj/xcuserdata",
|
21
24
|
"cpp",
|
22
25
|
"*.podspec",
|
23
|
-
"!ios/build",
|
24
26
|
"!**/__tests__",
|
25
27
|
"!**/__fixtures__",
|
26
28
|
"!**/__mocks__",
|
@@ -112,6 +114,6 @@
|
|
112
114
|
},
|
113
115
|
"dependencies": {
|
114
116
|
"@revenuecat/purchases-typescript-internal": "8.10.1",
|
115
|
-
"react-native-purchases": "7.
|
117
|
+
"react-native-purchases": "7.19.0"
|
116
118
|
}
|
117
119
|
}
|
package/src/index.tsx
CHANGED
@@ -15,29 +15,28 @@ import React, { type ReactNode, useEffect, useState } from "react";
|
|
15
15
|
export { PAYWALL_RESULT } from "@revenuecat/purchases-typescript-internal";
|
16
16
|
|
17
17
|
const LINKING_ERROR =
|
18
|
-
`The package 'react-native-purchases-
|
18
|
+
`The package 'react-native-purchases-ui' doesn't seem to be linked. Make sure: \n\n` +
|
19
19
|
Platform.select({ios: "- You have run 'pod install'\n", default: ''}) +
|
20
20
|
'- You rebuilt the app after installing the package\n' +
|
21
21
|
'- You are not using Expo Go\n';
|
22
22
|
|
23
23
|
const RNPaywalls = NativeModules.RNPaywalls;
|
24
24
|
|
25
|
-
|
25
|
+
if (!RNPaywalls) {
|
26
|
+
throw new Error(LINKING_ERROR);
|
27
|
+
}
|
26
28
|
|
27
|
-
|
28
|
-
style?: StyleProp<ViewStyle>;
|
29
|
-
children?: ReactNode;
|
30
|
-
};
|
29
|
+
const eventEmitter = new NativeEventEmitter(RNPaywalls);
|
31
30
|
|
32
31
|
const InternalPaywall =
|
33
32
|
UIManager.getViewManagerConfig('Paywall') != null
|
34
|
-
? requireNativeComponent<
|
33
|
+
? requireNativeComponent<FullScreenPaywallViewProps>('Paywall')
|
35
34
|
: () => {
|
36
35
|
throw new Error(LINKING_ERROR);
|
37
36
|
};
|
38
37
|
|
39
38
|
const InternalPaywallFooterView = UIManager.getViewManagerConfig('Paywall') != null
|
40
|
-
? requireNativeComponent<
|
39
|
+
? requireNativeComponent<FooterPaywallViewProps>('RCPaywallFooterView')
|
41
40
|
: () => {
|
42
41
|
throw new Error(LINKING_ERROR);
|
43
42
|
};
|
@@ -61,6 +60,31 @@ export type PresentPaywallIfNeededParams = PresentPaywallParams & {
|
|
61
60
|
requiredEntitlementIdentifier: string;
|
62
61
|
}
|
63
62
|
|
63
|
+
export interface PaywallViewOptions {
|
64
|
+
offering?: PurchasesOffering | null;
|
65
|
+
}
|
66
|
+
|
67
|
+
export interface FullScreenPaywallViewOptions extends PaywallViewOptions {
|
68
|
+
// Additional properties for FullScreenPaywallViewOptions can be added here if needed in the future
|
69
|
+
}
|
70
|
+
|
71
|
+
// Currently the same as the base type, but can be extended later if needed
|
72
|
+
export interface FooterPaywallViewOptions extends PaywallViewOptions {
|
73
|
+
// Additional properties for FooterPaywallViewOptions can be added here if needed in the future
|
74
|
+
}
|
75
|
+
|
76
|
+
type FullScreenPaywallViewProps = {
|
77
|
+
style?: StyleProp<ViewStyle>;
|
78
|
+
children?: ReactNode;
|
79
|
+
options?: FullScreenPaywallViewOptions;
|
80
|
+
};
|
81
|
+
|
82
|
+
type FooterPaywallViewProps = {
|
83
|
+
style?: StyleProp<ViewStyle>;
|
84
|
+
children?: ReactNode;
|
85
|
+
options?: FooterPaywallViewOptions;
|
86
|
+
};
|
87
|
+
|
64
88
|
export default class RevenueCatUI {
|
65
89
|
|
66
90
|
private static Defaults = {
|
@@ -112,11 +136,11 @@ export default class RevenueCatUI {
|
|
112
136
|
return RNPaywalls.presentPaywallIfNeeded(requiredEntitlementIdentifier, offering?.identifier ?? null, displayCloseButton)
|
113
137
|
}
|
114
138
|
|
115
|
-
public static Paywall: React.FC<
|
139
|
+
public static Paywall: React.FC<FullScreenPaywallViewProps> = (props) => (
|
116
140
|
<InternalPaywall {...props} style={[{flex: 1}, props.style]}/>
|
117
141
|
);
|
118
142
|
|
119
|
-
public static PaywallFooterContainerView: React.FC<
|
143
|
+
public static PaywallFooterContainerView: React.FC<FooterPaywallViewProps> = ({style, children, options}) => {
|
120
144
|
// We use 20 as the default paddingBottom because that's the corner radius in the Android native SDK.
|
121
145
|
// We also listen to safeAreaInsetsDidChange which is only sent from iOS and which is triggered when the
|
122
146
|
// safe area insets change. Not adding this extra padding on iOS will cause the content of the scrollview
|
@@ -148,7 +172,7 @@ export default class RevenueCatUI {
|
|
148
172
|
{children}
|
149
173
|
</ScrollView>
|
150
174
|
{/*Adding negative margin to the footer view to make it overlap with the extra padding of the scroll*/}
|
151
|
-
<InternalPaywallFooterView style={{marginTop: -20}}/>
|
175
|
+
<InternalPaywallFooterView style={{marginTop: -20}} options={options}/>
|
152
176
|
</View>
|
153
177
|
);
|
154
178
|
};
|