react-native-purchases 7.4.0-beta.1 → 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.
@@ -24,6 +24,6 @@ Pod::Spec.new do |spec|
24
24
  ]
25
25
 
26
26
  spec.dependency "React-Core"
27
- spec.dependency "PurchasesHybridCommon", '7.4.0-beta.1'
27
+ spec.dependency "PurchasesHybridCommon", '7.4.0-beta.3'
28
28
  spec.swift_version = '5.7'
29
29
  end
@@ -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.1'
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.1'
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.1";
48
+ public static final String PLUGIN_VERSION = "7.4.0-beta.3";
49
49
 
50
50
  private final ReactApplicationContext reactContext;
51
51
 
@@ -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.vc.view;
20
+ return [proxy createPaywallView].view;
21
21
  } else {
22
- // TODO: log something
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,24 +6,76 @@
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
+
47
+ - (NSArray<NSString *> *)supportedEvents {
48
+ return @[];
49
+ }
50
+
51
+ - (dispatch_queue_t)methodQueue {
52
+ return dispatch_get_main_queue();
53
+ }
54
+
55
+ - (PaywallProxy *)paywalls API_AVAILABLE(ios(15.0)){
56
+ return self.paywallProxy;
57
+ }
58
+
59
+ // MARK: -
60
+
13
61
  RCT_EXPORT_METHOD(presentPaywall) {
14
62
  if (@available(iOS 15.0, *)) {
15
- [PaywallProxy presentPaywall];
63
+ [self.paywalls presentPaywall];
16
64
  } else {
17
- // TODO: log
65
+ [self logPaywallsUnsupportedError];
18
66
  }
19
67
  }
20
68
 
21
69
  RCT_EXPORT_METHOD(presentPaywallIfNeeded:(NSString *)requiredEntitlementIdentifier) {
22
70
  if (@available(iOS 15.0, *)) {
23
- [PaywallProxy presentPaywallIfNeededWithRequiredEntitlementIdentifier:requiredEntitlementIdentifier];
71
+ [self.paywalls presentPaywallIfNeededWithRequiredEntitlementIdentifier:requiredEntitlementIdentifier];
24
72
  } else {
25
- // TODO: log
73
+ [self logPaywallsUnsupportedError];
26
74
  }
27
75
  }
28
76
 
77
+ - (void)logPaywallsUnsupportedError {
78
+ NSLog(@"Error: attempted to present paywalls on unsupported iOS version.");
79
+ }
80
+
29
81
  @end
package/ios/RNPurchases.m CHANGED
@@ -470,7 +470,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
470
470
  }
471
471
 
472
472
  - (NSString *)platformFlavorVersion {
473
- return @"7.4.0-beta.1";
473
+ return @"7.4.0-beta.3";
474
474
  }
475
475
 
476
476
  @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": "7.4.0-beta.1",
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",
@@ -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.1/" />
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>