Skip to content

feat: Dont show cancel path if lifetime subscription#4755

Merged
facumenzella merged 8 commits into
mainfrom
feat/filter-cancel-if-lifetime
Feb 7, 2025
Merged

feat: Dont show cancel path if lifetime subscription#4755
facumenzella merged 8 commits into
mainfrom
feat/filter-cancel-if-lifetime

Conversation

@facumenzella

Copy link
Copy Markdown
Member

Motivation

Display only the paths that are relevant to the subscription

Description

Doing this in the backend requires some extra work, so for now we'll handle it in the client. ManageSubscriptionsViewModel has the relevant change. The other changes are just removing some unnecessary code, and re-organising stuff.

Comment thread RevenueCatUI/CustomerCenter/Views/ManageSubscriptionsButtonsView.swift Outdated
Comment thread RevenueCatUI/CustomerCenter/Views/ManageSubscriptionsButtonsView.swift Outdated
Comment thread RevenueCatUI/CustomerCenter/ViewModels/ManageSubscriptionsViewModel.swift Outdated
@facumenzella facumenzella requested a review from vegaro February 4, 2025 17:22
Comment thread RevenueCatUI/CustomerCenter/Data/CustomerCenterConfigTestData.swift Outdated
Comment thread RevenueCatUI/CustomerCenter/Data/PurchaseInformation.swift Outdated
Comment thread RevenueCatUI/CustomerCenter/Data/PurchaseInformation.swift Outdated
@facumenzella facumenzella requested a review from vegaro February 6, 2025 11:38

@vegaro vegaro left a comment

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.

Another case I am thinking we shouldn't show the cancel path is if the product is a promotional. To detect a promotional, I've normally checked for the prefix of the product identifier. To test it, you can grant your user a promotional in the dashboard

Feel free to merge this and address that in another PR

@facumenzella facumenzella merged commit 5354cbe into main Feb 7, 2025
@facumenzella facumenzella deleted the feat/filter-cancel-if-lifetime branch February 7, 2025 10:14
@facumenzella

Copy link
Copy Markdown
Member Author

@vegaro I'll add another ticket and apply that too

facumenzella added a commit to RevenueCat/purchases-android that referenced this pull request Feb 12, 2025
### Motivation
CANCEL should not be shown if the product is a lifetime product.

### Description
This PR follows the same logic as Android, and filters out CANCEL if the
product is lifetime:
1. Check entitlement
2. Subscription is false
3. Non subscription is true

See RevenueCat/purchases-ios#4755
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