-
Notifications
You must be signed in to change notification settings - Fork 332
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
Changes from 86 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
444d450
Create file
vegaro c5aaf56
[Customer Center] Create `CustomerCenterView` (#3919)
vegaro 9bc2c08
[Customer Center] Add API call to get Customer Center config (#3933)
vegaro fec9486
[Customer Center] Build feedback survey from JSON (#3959)
vegaro b087782
[Customer Center] Show the right subscription on the Manage Subscript…
JayShortway 6cd489f
[CustomerCenter] Add `presentCustomerCenter` modifier (#4053)
tonidero 5ea67b2
[Customer Center] Adds the Customer Center to PaywallsTester (#4055)
JayShortway 5030a3c
[Customer Center] Improves the UI of the current subscription (#4072)
JayShortway 1868044
[Customer Center] Updates the presentation of the refund status (#4082)
JayShortway 2a9cd2c
[CustomerCenter] Add action handler (#4057)
tonidero fa06324
[Customer Center] Promotional Offers support (#3968)
vegaro 0d7530e
Move No subscriptions page strings to Localization (#4089)
tonidero bd7e4c9
Merge branch 'main' into integration/customer_support_workflow
tonidero b45e274
[Customer Center] Add colors support (#3983)
vegaro dcbfb7d
[Customer Center] SubscriptionDetailsView gets its strings from Commo…
JayShortway ced36e8
Merge branch 'main' into integration/customer_support_workflow
vegaro e3f9250
Merge branch 'main' into integration/customer_support_workflow
vegaro dc22e0d
ignore tags
vegaro acbc391
[Customer Center] Fix project.pbxproj (#4122)
vegaro 29340ca
[Customer Center] Fix `BackendGetCustomerCenterConfigTests` (#4124)
vegaro 7a9e3e9
Merge branch 'main' into integration/customer_support_workflow
vegaro 2977e6b
[Customer Center] Add contact support button (#4023)
vegaro b6a3069
Merge branch 'main' into integration/customer_support_workflow
vegaro c255107
[Customer Center] Fix checking eligibility (#4138)
vegaro 167a609
[Customer Center] Make colors nullable (#4134)
vegaro 43ad9b1
Merge branch 'main' into integration/customer_support_workflow
vegaro dbd43aa
[Customer Center] Fix for disabled promo offer button (#4142)
vegaro 6084a2c
Version 5.2.2-customercenter.alpha.3
vegaro 7e9b355
[Customer Center] Fixes an extra blank screen after popping FeedbackS…
JayShortway e1b0cf4
[Customer Center] Improve subscription details view (#4152)
codykerns 92db864
Customer Center compilation flag (#4149)
aboedo 789d26a
Merge branch 'main' of github.com:RevenueCat/purchases-ios into integ…
tonidero c52f3cf
[Customer Center] UI polish for empty content (#4147)
codykerns 3662879
[Customer Center] Use system navigation titles (#4161)
codykerns 9284107
Disable `CustomerCenter` build flags (#4160)
tonidero 759fd53
Fix compilation issues in older targets
tonidero ae44b59
Adds SemanticVersion
JayShortway 52195fb
Revert "Disable `CustomerCenter` build flags (#4160)"
JayShortway f1e4da2
CustomerCenterViewModel checks whether the app is the latest version.
JayShortway 9e943fa
Merge branch 'main' into check-latest-version
JayShortway 08000e5
Cleanup
JayShortway 9d5cffb
More cleanup.
JayShortway b11307b
Merge branch 'main' into check-latest-version
JayShortway dc1f795
CustomerCenterConfigResponse now provides lastPublishedAppVersion.
JayShortway be65640
Fixes CustomerCenterConfigDataTests.
JayShortway 507d91c
Adds some more test cases.
JayShortway 71171ac
Correctly (?) adds SemanticVersion to Xcode.
JayShortway 5be6750
Fixes some warnings and adds the compiler flag to SemanticVersion[Tes…
JayShortway 305d28e
Fixes a compile error.
JayShortway b9e241b
Fixes some warnings.
JayShortway 50d7102
SemanticVersion only accepts UInts now.
JayShortway 54c6ff6
appIsLatestVersion is initialized with defaultAppIsLatestVersion.
JayShortway 8072747
Renames takeVersion to versionString.
JayShortway a64e6b4
Fixes a compilation error in SemanticVersionTests.
JayShortway 385ab4e
defaultAppIsLatestVersion is static now.
JayShortway bbe3fca
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero 7329cb6
Uses the existing SystemInfo.appVersion.
JayShortway 19b7881
Uses a single guard let statement.
JayShortway 1473222
Adds some more test cases.
JayShortway 1ae81ea
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway d32e24a
Uses CFBundleShortVersionString directly.
JayShortway b72d05c
Fixes CustomerCenterConfigDataAPI.
JayShortway aae889a
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero 1412b6b
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway 0c2bdaa
Merge branch 'main' into check-latest-version
JayShortway a9d86ae
Removes references to non-existent ManageSubscriptionsButtonStyle.swi…
JayShortway e1854c0
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero d87b22f
Adds references to ButtonStyles.swift.
JayShortway 469bc71
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero 7ea9f06
Merge branch 'main' into ui-latest-version
JayShortway 7402a25
Adds AppUpdateWarningView.
JayShortway 9e38a87
CustomerCenterView shows AppUpdateWarningView when needed.
JayShortway a4519d9
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway ca983e0
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway b5724a0
Merge branch 'main' into ui-latest-version
JayShortway ce2d5bb
Merge branch 'main' into ui-latest-version
JayShortway 595a4b2
Correctly constructs CompatibilityContentUnavailableView using update…
JayShortway 612ec19
Apply copy suggestions from code review
JayShortway e86ca2a
Uses .compatibleTopBarTrailing.
JayShortway eac6e3e
Adds an animation when navigating past the app update warning.
JayShortway 0ff168f
Merge branch 'main' into ui-latest-version
JayShortway 5151ff0
Merge branch 'main' into ui-latest-version
JayShortway 84cc70b
Restyles AppUpdateWarningView in line with the updated WrongPlatformV…
JayShortway 5a4e72d
Merge branch 'main' into ui-latest-version
JayShortway 54d6675
Merge branch 'main' into ui-latest-version
JayShortway 6422533
Updates the dismiss button.
JayShortway acb4f68
Updates the copy.
JayShortway 5e3bebe
Updates the icon.
JayShortway 38af427
Merge branch 'main' into ui-latest-version
JayShortway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
RevenueCatUI/CustomerCenter/Views/AppUpdateWarningView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// | ||
// Copyright RevenueCat Inc. All Rights Reserved. | ||
// | ||
// Licensed under the MIT License (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://opensource.org/licenses/MIT | ||
// | ||
// AppUpdateWarningView.swift | ||
// | ||
// Created by JayShortway on 16/08/2024. | ||
|
||
#if CUSTOMER_CENTER_ENABLED | ||
|
||
import RevenueCat | ||
import SwiftUI | ||
|
||
#if os(iOS) | ||
|
||
@available(iOS 15.0, *) | ||
@available(macOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
struct AppUpdateWarningView: View { | ||
let onUpdateAppClick: () -> Void | ||
let onContinueAnywayClick: () -> Void | ||
|
||
@Environment(\.localization) | ||
private var localization: CustomerCenterConfigData.Localization | ||
@Environment(\.appearance) | ||
private var appearance: CustomerCenterConfigData.Appearance | ||
@Environment(\.colorScheme) | ||
private var colorScheme | ||
|
||
@ViewBuilder | ||
var content: some View { | ||
ZStack { | ||
List { | ||
Section { | ||
CompatibilityContentUnavailableView( | ||
localization.commonLocalizedString(for: .updateWarningTitle), | ||
systemImage: "arrowshape.up.circle.fill", | ||
description: Text(localization.commonLocalizedString(for: .updateWarningDescription)) | ||
) | ||
} | ||
|
||
Section { | ||
Button(localization.commonLocalizedString(for: .updateWarningUpdate)) { | ||
onUpdateAppClick() | ||
} | ||
.buttonStyle(ProminentButtonStyle()) | ||
.padding(.top, 4) | ||
|
||
Button(localization.commonLocalizedString(for: .updateWarningIgnore)) { | ||
onContinueAnywayClick() | ||
} | ||
.buttonStyle(TextButtonStyle()) | ||
} | ||
.listRowSeparator(.hidden) | ||
} | ||
} | ||
.toolbar { | ||
ToolbarItem(placement: .compatibleTopBarTrailing) { | ||
DismissCircleButton() | ||
} | ||
} | ||
} | ||
|
||
var body: some View { | ||
if #available(iOS 16.0, *) { | ||
NavigationStack { | ||
content | ||
} | ||
} else { | ||
NavigationView { | ||
content | ||
} | ||
} | ||
} | ||
} | ||
|
||
/// This is a workaround to be able to have 2 buttons in a single Section. Buttons without ButtonStyles make the entire | ||
/// section clickable. | ||
@available(iOS 15.0, *) | ||
@available(macOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
private struct TextButtonStyle: PrimitiveButtonStyle { | ||
|
||
func makeBody(configuration: PrimitiveButtonStyleConfiguration) -> some View { | ||
Button(action: { configuration.trigger() }, label: { | ||
configuration.label.frame(maxWidth: .infinity) | ||
}) | ||
} | ||
|
||
} | ||
|
||
#if DEBUG | ||
|
||
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | ||
@available(macOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
struct AppUpdateWarningView_Previews: PreviewProvider { | ||
|
||
static var previews: some View { | ||
Group { | ||
AppUpdateWarningView( | ||
onUpdateAppClick: { | ||
|
||
}, | ||
onContinueAnywayClick: { | ||
|
||
} | ||
) | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
import Foundation | ||
|
||
// swiftlint:disable missing_docs nesting file_length | ||
// swiftlint:disable missing_docs nesting file_length type_body_length | ||
public typealias RCColor = PaywallColor | ||
|
||
public struct CustomerCenterConfigData { | ||
|
@@ -73,6 +73,10 @@ public struct CustomerCenterConfigData { | |
case defaultBody = "default_body" | ||
case defaultSubject = "default_subject" | ||
case dismiss = "dismiss" | ||
case updateWarningTitle = "update_warning_title" | ||
case updateWarningDescription = "update_warning_description" | ||
case updateWarningUpdate = "update_warning_update" | ||
case updateWarningIgnore = "update_warning_ignore" | ||
Comment on lines
+76
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if we want to make these strings specific to the app update warning screen? |
||
|
||
var defaultValue: String { | ||
switch self { | ||
|
@@ -118,6 +122,17 @@ public struct CustomerCenterConfigData { | |
return "Support Request" | ||
case .dismiss: | ||
return "Dismiss" | ||
case .updateWarningTitle: | ||
return "Update the app to fix the problem." | ||
case .updateWarningDescription: | ||
return """ | ||
A new update is available. Downloading the latest version of the app may help solve the \ | ||
problem. | ||
""" | ||
case .updateWarningUpdate: | ||
return "Update" | ||
case .updateWarningIgnore: | ||
return "Continue" | ||
} | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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):
There was a problem hiding this comment.
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.