Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Customer Center] Shows a warning when the app is not the latest version #4193

Merged
merged 89 commits into from
Aug 27, 2024

Conversation

JayShortway
Copy link
Member

@JayShortway JayShortway commented Aug 16, 2024

In this PR

  • A new AppUpdateWarningView is added, which is heavily inspired by WrongPlatformView.
  • CustomerCenterView shows the AppUpdateWarningView when required.
Simulator Screenshot - iPhone 15 Pro

Not in this PR

  • Actually opening the App Store when the user presses "Update". Will do that in a follow-up. Have asked for input on Slack.

vegaro and others added 30 commits July 17, 2024 11:21
Base branch is `integration/customer_support_workflow` so we don't merge
into `main` yet

Borrows a lot from #3865

Creates a new `CustomerCenterView` that can be used as a customer
support workflow starting point.

All details can be found in
https://linear.app/revenuecat/project/sdk-support-workflow-cf7f6a1d5340/overview

---------

Co-authored-by: Will Taylor <wtaylor151@gmail.com>
Co-authored-by: James Borthwick <109382862+jamesrb1@users.noreply.github.com>
Adds `Purchases.shared.loadCustomerCenter()` that calls a new backend
endpoint that returns the customer center configuration

This API call doesn't exist yet and it will change. This PR is the
ground work so that we don't have to wait for the backend to add this
API and we can already pretend the API is there.

---------

Co-authored-by: RevenueCat Git Bot <72824662+RCGitBot@users.noreply.github.com>
Based off #3933 



https://github.com/RevenueCat/purchases-ios/assets/664544/11eae984-294a-4e14-8c40-7c2d50994c09

Can probably use some animations, but tuning that up will come up later

It will open a feedback survey for an option if there's one
### Description
This adds a modifier, `presentCustomerCenter` that can be used to more
simply display the customer center. The API looks like:
```
.presentCustomerCenter(isPresented: self.$presentingCustomerCenter) {
    self.presentingCustomerCenter = false
}
```
### Description
This PR provides a possible approach to implementing an "action"
handler. This allows developer to respond to events that happen during
the customer support flow.

The current approach consists of making `CustomerCenterActionHandler`, a
lambda that receives an action that can be passed in by the developer.
Then calling that with the appropriate action from the customer center.
This PR also moves some code to the view model for simplicity and moving
logic away from the view layer.
Adds displaying a Promotional Offer if the path has an offer id
configured

---------

Co-authored-by: JayShortway <29483617+JayShortway@users.noreply.github.com>
Co-authored-by: RevenueCat Git Bot <72824662+RCGitBot@users.noreply.github.com>
### Description
This is based on the changes in #3968 

This PR:
- Moves the strings currently hardcode into the
`CustomerCenterConfigData.Localization` object.
- Fixes an issue compiling paywall tester introduced in a previous PR
- Modifies how we read backend strings to not account for the `common_`
prefix, which is already removed by the backend.
Builds buttons from the Appearance object in the JSON
I think this comes from a bad merge, because this project doesn't touch
that file. Xcode is automatically cleaning it up
Add contact support button to the `ManageSubscriptionsView`

---------

Co-authored-by: Toni Rico <toni.rico.diez@revenuecat.com>
We were not checking if the user is eligible for the promotional offer
before trying to load it
- Adapt changes from RevenueCat/khepri#9707
which makes colors nullable and adds new colors for buttons
- Change background and text color in all screens
- Modified buttons to use `.buttonStyle(.borderedProminent)` so they
look native by default
- Applied accent color to back button in navigation view
I noticed the purchase button for the promo offers is always disabled.
Changing the order of the modifiers fixes it
The subscription details view could take advantage of more available
space

- expands details view
- increases font sizes
- wraps in a scrollview for smaller screen sizes
- softens shadow
- have buttons fill available space, limit width via container views

| New           | Old           |
|:-------------:|:-------------:|
| ![New
Version](https://github.com/user-attachments/assets/27c4a7fd-60be-4536-b88c-b2c9c6141c8f)
| ![Old
Version](https://github.com/user-attachments/assets/9bd80877-4fa6-4c7e-a813-5e7a3c1bbcc2)
|
@JayShortway JayShortway requested review from a team and jamesrb1 August 22, 2024 10:18
@JayShortway
Copy link
Member Author

I updated this PR after the redesign of the existing "no content" screens in #4204. Screenshot in the OP is updated. Would be great to get a final look 🙏

Commit: 84cc70b

Section {
CompatibilityContentUnavailableView(
localization.commonLocalizedString(for: .updateWarningTitle),
systemImage: "arrowshape.up.circle.fill",
Copy link
Contributor

@jamesrb1 jamesrb1 Aug 23, 2024

Choose a reason for hiding this comment

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

This image is iOS 17+ only. You can check in Xcode with this dialog (command-shift-L):

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah TIL, thanks! Updated here: 5e3bebe.

Copy link
Contributor

@jamesrb1 jamesrb1 left a comment

Choose a reason for hiding this comment

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

Looks great!

@JayShortway JayShortway merged commit 7098377 into main Aug 27, 2024
5 checks passed
@JayShortway JayShortway deleted the ui-latest-version branch August 27, 2024 08:07
vegaro pushed a commit that referenced this pull request Aug 30, 2024
**This is an automatic release.**

### Bugfixes
* Fix `compatibleTopBarTrailing` in MacOS and api tests (#4226) via
Cesar de la Vega (@vegaro)
* [Paywall] Fix restoreStarted not being called on
`presentPaywallIfNeeded` when using `requiredEntitlementIdentifier`
(#4223) via Josh Holtz (@joshdholtz)
* [CustomerCenter] Move sheet and restore alert creation to
`ManageSubscriptionsView` (#4220) via Cesar de la Vega (@vegaro)
* [EXTERNAL] `Custom Entitlements Computation`: fix support display on
debug screen (#4215) by @NachoSoto (#4218) via Toni Rico (@tonidero)
* [Customer Center] Add padding to `No thanks` in promotional offer
screen (#4221) via Cesar de la Vega (@vegaro)
* Fix version number in plist files (#4213) via Cesar de la Vega
(@vegaro)
* fix mac os sandbox check slowness (#3879) via Andy Boedo (@aboedo)
* [Customer Center] Fix `FeedbackSurveyView` not opening (#4208) via
Cesar de la Vega (@vegaro)
* Remove `unneeded_override` disable to fix linter (#4209) via Cesar de
la Vega (@vegaro)
### Dependency Updates
* Bump rexml from 3.3.3 to 3.3.6 in
/Tests/InstallationTests/CocoapodsInstallation (#4210) via
dependabot[bot] (@dependabot[bot])
* Bump rexml from 3.3.3 to 3.3.6 (#4211) via dependabot[bot]
(@dependabot[bot])
### Other Changes
* Update readme wording (#3914) via James Borthwick (@jamesrb1)
* Set a maximum duration for iOS 15 tests (#4229) via Cesar de la Vega
(@vegaro)
* Paywall Components Initial Commit (#4224) via James Borthwick
(@jamesrb1)
* [CustomerCenter] Open App Store when the user wants to update their
app (#4199) via JayShortway (@JayShortway)
* [Customer Center] Shows a warning when the app is not the latest
version (#4193) via JayShortway (@JayShortway)
* Fix integration tests simulator version (#4219) via Cesar de la Vega
(@vegaro)
* Pin swift-docc-plugin to 1.3.0 (#4216) via James Borthwick (@jamesrb1)
nyeu pushed a commit that referenced this pull request Oct 2, 2024
**This is an automatic release.**

### Bugfixes
* Fix `compatibleTopBarTrailing` in MacOS and api tests (#4226) via
Cesar de la Vega (@vegaro)
* [Paywall] Fix restoreStarted not being called on
`presentPaywallIfNeeded` when using `requiredEntitlementIdentifier`
(#4223) via Josh Holtz (@joshdholtz)
* [CustomerCenter] Move sheet and restore alert creation to
`ManageSubscriptionsView` (#4220) via Cesar de la Vega (@vegaro)
* [EXTERNAL] `Custom Entitlements Computation`: fix support display on
debug screen (#4215) by @NachoSoto (#4218) via Toni Rico (@tonidero)
* [Customer Center] Add padding to `No thanks` in promotional offer
screen (#4221) via Cesar de la Vega (@vegaro)
* Fix version number in plist files (#4213) via Cesar de la Vega
(@vegaro)
* fix mac os sandbox check slowness (#3879) via Andy Boedo (@aboedo)
* [Customer Center] Fix `FeedbackSurveyView` not opening (#4208) via
Cesar de la Vega (@vegaro)
* Remove `unneeded_override` disable to fix linter (#4209) via Cesar de
la Vega (@vegaro)
### Dependency Updates
* Bump rexml from 3.3.3 to 3.3.6 in
/Tests/InstallationTests/CocoapodsInstallation (#4210) via
dependabot[bot] (@dependabot[bot])
* Bump rexml from 3.3.3 to 3.3.6 (#4211) via dependabot[bot]
(@dependabot[bot])
### Other Changes
* Update readme wording (#3914) via James Borthwick (@jamesrb1)
* Set a maximum duration for iOS 15 tests (#4229) via Cesar de la Vega
(@vegaro)
* Paywall Components Initial Commit (#4224) via James Borthwick
(@jamesrb1)
* [CustomerCenter] Open App Store when the user wants to update their
app (#4199) via JayShortway (@JayShortway)
* [Customer Center] Shows a warning when the app is not the latest
version (#4193) via JayShortway (@JayShortway)
* Fix integration tests simulator version (#4219) via Cesar de la Vega
(@vegaro)
* Pin swift-docc-plugin to 1.3.0 (#4216) via James Borthwick (@jamesrb1)
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.

6 participants