react-native-purchases-ui 8.11.9 → 8.11.10

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.
@@ -8,7 +8,7 @@ buildscript {
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath "com.android.tools.build:gradle:7.2.1"
11
+ classpath "com.android.tools.build:gradle:8.11.1"
12
12
  // noinspection DifferentKotlinGradleVersion
13
13
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
14
  }
@@ -59,7 +59,7 @@ android {
59
59
  minSdkVersion getExtOrIntegerDefault("minSdkVersion")
60
60
  targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
61
61
  versionCode 1
62
- versionName '8.11.9'
62
+ versionName '8.11.10'
63
63
  }
64
64
 
65
65
  buildTypes {
@@ -31,4 +31,21 @@ class WrappedPaywallComposeView(context: Context) : ComposeViewWrapper<PaywallVi
31
31
  fun setDisplayDismissButton(shouldDisplayDismissButton: Boolean) {
32
32
  wrappedView?.setDisplayDismissButton(shouldDisplayDismissButton)
33
33
  }
34
+
35
+ // Ensure the view re-measures properly after loading state changes
36
+ // Similar logic used in PaywallFooterViewManager
37
+ override fun requestLayout() {
38
+ super.requestLayout()
39
+ post(measureAndLayout)
40
+ }
41
+
42
+ private val measureAndLayout = Runnable {
43
+ if (isAttachedToWindow) {
44
+ measure(
45
+ MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
46
+ MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
47
+ )
48
+ layout(left, top, right, bottom)
49
+ }
50
+ }
34
51
  }
@@ -189,7 +189,7 @@ class RevenueCatUI {
189
189
 
190
190
  /**
191
191
  * Presents the customer center to the user.
192
- *
192
+ *
193
193
  * @param {PresentCustomerCenterParams} params - Optional parameters for presenting the customer center.
194
194
  * @returns {Promise<void>} A promise that resolves when the customer center is presented.
195
195
  */
@@ -176,7 +176,7 @@ export default class RevenueCatUI {
176
176
 
177
177
  /**
178
178
  * Presents the customer center to the user.
179
- *
179
+ *
180
180
  * @param {PresentCustomerCenterParams} params - Optional parameters for presenting the customer center.
181
181
  * @returns {Promise<void>} A promise that resolves when the customer center is presented.
182
182
  */
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": "8.11.9",
4
+ "version": "8.11.10",
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",
@@ -115,6 +115,6 @@
115
115
  },
116
116
  "dependencies": {
117
117
  "@revenuecat/purchases-typescript-internal": "14.2.0",
118
- "react-native-purchases": "8.11.9"
118
+ "react-native-purchases": "8.11.10"
119
119
  }
120
120
  }
package/src/index.tsx CHANGED
@@ -162,7 +162,7 @@ type InternalFooterPaywallViewProps = FooterPaywallViewProps & {
162
162
  onMeasure?: ({height}: { height: number }) => void;
163
163
  };
164
164
 
165
- export type CustomerCenterManagementOption =
165
+ export type CustomerCenterManagementOption =
166
166
  | 'cancel'
167
167
  | 'custom_url'
168
168
  | 'missing_purchase'
@@ -171,7 +171,7 @@ export type CustomerCenterManagementOption =
171
171
  | 'unknown'
172
172
  | string; // This is to prevent breaking changes when the native SDK adds new options
173
173
 
174
- export type CustomerCenterManagementOptionEvent =
174
+ export type CustomerCenterManagementOptionEvent =
175
175
  | { option: 'custom_url'; url: string }
176
176
  | { option: Exclude<CustomerCenterManagementOption, 'custom_url'>; url: null };
177
177
 
@@ -180,22 +180,22 @@ export interface CustomerCenterCallbacks {
180
180
  * Called when a feedback survey is completed with the selected option ID.
181
181
  */
182
182
  onFeedbackSurveyCompleted?: ({feedbackSurveyOptionId}: { feedbackSurveyOptionId: string }) => void;
183
-
183
+
184
184
  /**
185
185
  * Called when the manage subscriptions section is being shown.
186
186
  */
187
187
  onShowingManageSubscriptions?: () => void;
188
-
188
+
189
189
  /**
190
190
  * Called when a restore operation is completed successfully.
191
191
  */
192
192
  onRestoreCompleted?: ({customerInfo}: { customerInfo: CustomerInfo }) => void;
193
-
193
+
194
194
  /**
195
195
  * Called when a restore operation fails.
196
196
  */
197
197
  onRestoreFailed?: ({error}: { error: PurchasesError }) => void;
198
-
198
+
199
199
  /**
200
200
  * Called when a restore operation starts.
201
201
  */
@@ -205,7 +205,7 @@ export interface CustomerCenterCallbacks {
205
205
  * Called when a refund request starts with the product identifier. iOS-only callback.
206
206
  */
207
207
  onRefundRequestStarted?: ({productIdentifier}: { productIdentifier: string }) => void;
208
-
208
+
209
209
  /**
210
210
  * Called when a refund request completes with status information. iOS-only callback.
211
211
  */
@@ -254,7 +254,7 @@ export default class RevenueCatUI {
254
254
  displayCloseButton = RevenueCatUI.Defaults.PRESENT_PAYWALL_DISPLAY_CLOSE_BUTTON,
255
255
  fontFamily,
256
256
  }: PresentPaywallParams = {}): Promise<PAYWALL_RESULT> {
257
- RevenueCatUI.logWarningIfPreviewAPIMode("presentPaywall");
257
+ RevenueCatUI.logWarningIfPreviewAPIMode("presentPaywall");
258
258
  return RNPaywalls.presentPaywall(
259
259
  offering?.identifier ?? null,
260
260
  displayCloseButton,
@@ -281,7 +281,7 @@ export default class RevenueCatUI {
281
281
  displayCloseButton = RevenueCatUI.Defaults.PRESENT_PAYWALL_DISPLAY_CLOSE_BUTTON,
282
282
  fontFamily,
283
283
  }: PresentPaywallIfNeededParams): Promise<PAYWALL_RESULT> {
284
- RevenueCatUI.logWarningIfPreviewAPIMode("presentPaywallIfNeeded");
284
+ RevenueCatUI.logWarningIfPreviewAPIMode("presentPaywallIfNeeded");
285
285
  return RNPaywalls.presentPaywallIfNeeded(
286
286
  requiredEntitlementIdentifier,
287
287
  offering?.identifier ?? null,
@@ -383,7 +383,7 @@ export default class RevenueCatUI {
383
383
 
384
384
  /**
385
385
  * Presents the customer center to the user.
386
- *
386
+ *
387
387
  * @param {PresentCustomerCenterParams} params - Optional parameters for presenting the customer center.
388
388
  * @returns {Promise<void>} A promise that resolves when the customer center is presented.
389
389
  */
@@ -395,7 +395,7 @@ export default class RevenueCatUI {
395
395
  if (callbacks.onFeedbackSurveyCompleted) {
396
396
  const subscription = customerCenterEventEmitter.addListener(
397
397
  'onFeedbackSurveyCompleted',
398
- (event: { feedbackSurveyOptionId: string }) => callbacks.onFeedbackSurveyCompleted &&
398
+ (event: { feedbackSurveyOptionId: string }) => callbacks.onFeedbackSurveyCompleted &&
399
399
  callbacks.onFeedbackSurveyCompleted(event)
400
400
  );
401
401
  subscriptions.push(subscription);
@@ -412,7 +412,7 @@ export default class RevenueCatUI {
412
412
  if (callbacks.onRestoreCompleted) {
413
413
  const subscription = customerCenterEventEmitter.addListener(
414
414
  'onRestoreCompleted',
415
- (event: { customerInfo: CustomerInfo }) => callbacks.onRestoreCompleted &&
415
+ (event: { customerInfo: CustomerInfo }) => callbacks.onRestoreCompleted &&
416
416
  callbacks.onRestoreCompleted(event)
417
417
  );
418
418
  subscriptions.push(subscription);
@@ -421,7 +421,7 @@ export default class RevenueCatUI {
421
421
  if (callbacks.onRestoreFailed) {
422
422
  const subscription = customerCenterEventEmitter.addListener(
423
423
  'onRestoreFailed',
424
- (event: { error: PurchasesError }) => callbacks.onRestoreFailed &&
424
+ (event: { error: PurchasesError }) => callbacks.onRestoreFailed &&
425
425
  callbacks.onRestoreFailed(event)
426
426
  );
427
427
  subscriptions.push(subscription);
@@ -438,7 +438,7 @@ export default class RevenueCatUI {
438
438
  if (callbacks.onRefundRequestStarted) {
439
439
  const subscription = customerCenterEventEmitter.addListener(
440
440
  'onRefundRequestStarted',
441
- (event: { productIdentifier: string }) => callbacks.onRefundRequestStarted &&
441
+ (event: { productIdentifier: string }) => callbacks.onRefundRequestStarted &&
442
442
  callbacks.onRefundRequestStarted(event)
443
443
  );
444
444
  subscriptions.push(subscription);
@@ -447,7 +447,7 @@ export default class RevenueCatUI {
447
447
  if (callbacks.onRefundRequestCompleted) {
448
448
  const subscription = customerCenterEventEmitter.addListener(
449
449
  'onRefundRequestCompleted',
450
- (event: { productIdentifier: string; refundRequestStatus: REFUND_REQUEST_STATUS }) => callbacks.onRefundRequestCompleted &&
450
+ (event: { productIdentifier: string; refundRequestStatus: REFUND_REQUEST_STATUS }) => callbacks.onRefundRequestCompleted &&
451
451
  callbacks.onRefundRequestCompleted(event)
452
452
  );
453
453
  subscriptions.push(subscription);
@@ -456,7 +456,7 @@ export default class RevenueCatUI {
456
456
  if (callbacks.onManagementOptionSelected) {
457
457
  const subscription = customerCenterEventEmitter.addListener(
458
458
  'onManagementOptionSelected',
459
- (event: CustomerCenterManagementOptionEvent) => callbacks.onManagementOptionSelected &&
459
+ (event: CustomerCenterManagementOptionEvent) => callbacks.onManagementOptionSelected &&
460
460
  callbacks.onManagementOptionSelected(event)
461
461
  );
462
462
  subscriptions.push(subscription);
@@ -478,7 +478,7 @@ export default class RevenueCatUI {
478
478
  */
479
479
  public static PaywallFooterContainerView: React.FC<FooterPaywallViewProps> =
480
480
  RevenueCatUI.OriginalTemplatePaywallFooterContainerView;
481
-
481
+
482
482
  private static logWarningIfPreviewAPIMode(methodName: string) {
483
483
  if (usingPreviewAPIMode) {
484
484
  // tslint:disable-next-line:no-console