Skip to content

Fix presentPaywallIfNeeded#904

Merged
tonidero merged 1 commit into
paywallsfrom
fix-present-paywall-if-needed
Dec 22, 2023
Merged

Fix presentPaywallIfNeeded#904
tonidero merged 1 commit into
paywallsfrom
fix-present-paywall-if-needed

Conversation

@tonidero

Copy link
Copy Markdown
Contributor

We forgot a break when calling this method, which caused it to fall to the default case, resulting in the result being called twice, causing a crash. This deals with #902

@tonidero tonidero marked this pull request as ready for review December 22, 2023 07:59
@tonidero tonidero requested a review from a team December 22, 2023 08:00
case "presentPaywallIfNeeded":
final String requiredEntitlementIdentifier = call.argument("requiredEntitlementIdentifier");
presentPaywall(result, requiredEntitlementIdentifier);
break;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably would want to also add some tests for these but didn't want to delay fixing this... Definitely we should improve our coverage in the hybrids.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, yes. Nice find

@tonidero tonidero changed the title Fix presentPaywallIfNeeded Fix presentPaywallIfNeeded Dec 22, 2023
case "presentPaywallIfNeeded":
final String requiredEntitlementIdentifier = call.argument("requiredEntitlementIdentifier");
presentPaywall(result, requiredEntitlementIdentifier);
break;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, yes. Nice find

@tonidero

Copy link
Copy Markdown
Contributor Author

The freezed tests are unrelated to this PR

@tonidero tonidero closed this Dec 22, 2023
@tonidero tonidero deleted the fix-present-paywall-if-needed branch December 22, 2023 09:09
@tonidero tonidero restored the fix-present-paywall-if-needed branch December 22, 2023 09:09
@tonidero tonidero reopened this Dec 22, 2023
@tonidero tonidero merged commit af8b548 into paywalls Dec 22, 2023
@tonidero tonidero deleted the fix-present-paywall-if-needed branch December 22, 2023 09:09
@tonidero tonidero mentioned this pull request Dec 22, 2023
tonidero added a commit that referenced this pull request Dec 22, 2023
### New Features
* 📱 Initial support for cross-platform RevenueCat Paywalls 🐾 🧱 (#852)

#### Instructions:
- For Android, you need to change your `MainActivity` to subclass
`FlutterFragmentActivity` instead of `FlutterActivity`.
- Update `purchases-flutter` in your `pubspec.yaml`:
```yaml
dependencies:
  purchases_flutter: 6.6.0-beta.3
```

#### Usage:
```dart
await Purchases.presentPaywallIfNeeded("pro");
```

#### Limitations:

- Currently only full screen paywalls are supported
- There is no way to detect paywall events other than using
`addCustomerInfoUpdateListener`
- Android's `minSdkVersion` is temporarily increased from `19` to `24`
to support paywalls. This will be reverted in a future release as we
split `purchases_flutter` and `purchases_flutter_ui`

### Breaking changes from previous beta

- `PurchasesFlutterActivity` has been removed. Use
`FlutterFragmentActivity` provided by Flutter instead

### Fixes from previous beta
* Fix `presentPaywallIfNeeded` (#904) via Toni Rico (@tonidero)

### Other Changes
* Update paywalls latest main (#906) via Toni Rico (@tonidero)
* Update to use PHC PaywallHelpers instead of custom activity (#903) via
Toni Rico (@tonidero)
* Fix flutter analyze deprecation warnings (#872)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants