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

[CustomerCenter] Open App Store when the user wants to update their app #4199

Merged
merged 118 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
444d450
Create file
vegaro Jun 17, 2024
c5aaf56
[Customer Center] Create `CustomerCenterView` (#3919)
vegaro Jun 28, 2024
9bc2c08
[Customer Center] Add API call to get Customer Center config (#3933)
vegaro Jul 9, 2024
fec9486
[Customer Center] Build feedback survey from JSON (#3959)
vegaro Jul 11, 2024
b087782
[Customer Center] Show the right subscription on the Manage Subscript…
JayShortway Jul 16, 2024
6cd489f
[CustomerCenter] Add `presentCustomerCenter` modifier (#4053)
tonidero Jul 16, 2024
5ea67b2
[Customer Center] Adds the Customer Center to PaywallsTester (#4055)
JayShortway Jul 17, 2024
5030a3c
[Customer Center] Improves the UI of the current subscription (#4072)
JayShortway Jul 18, 2024
1868044
[Customer Center] Updates the presentation of the refund status (#4082)
JayShortway Jul 18, 2024
2a9cd2c
[CustomerCenter] Add action handler (#4057)
tonidero Jul 18, 2024
fa06324
[Customer Center] Promotional Offers support (#3968)
vegaro Jul 19, 2024
0d7530e
Move No subscriptions page strings to Localization (#4089)
tonidero Jul 19, 2024
bd7e4c9
Merge branch 'main' into integration/customer_support_workflow
tonidero Jul 19, 2024
b45e274
[Customer Center] Add colors support (#3983)
vegaro Jul 19, 2024
dcbfb7d
[Customer Center] SubscriptionDetailsView gets its strings from Commo…
JayShortway Jul 22, 2024
ced36e8
Merge branch 'main' into integration/customer_support_workflow
vegaro Jul 22, 2024
e3f9250
Merge branch 'main' into integration/customer_support_workflow
vegaro Jul 24, 2024
dc22e0d
ignore tags
vegaro Jul 24, 2024
acbc391
[Customer Center] Fix project.pbxproj (#4122)
vegaro Jul 29, 2024
29340ca
[Customer Center] Fix `BackendGetCustomerCenterConfigTests` (#4124)
vegaro Jul 29, 2024
7a9e3e9
Merge branch 'main' into integration/customer_support_workflow
vegaro Jul 29, 2024
2977e6b
[Customer Center] Add contact support button (#4023)
vegaro Jul 29, 2024
b6a3069
Merge branch 'main' into integration/customer_support_workflow
vegaro Jul 30, 2024
c255107
[Customer Center] Fix checking eligibility (#4138)
vegaro Jul 31, 2024
167a609
[Customer Center] Make colors nullable (#4134)
vegaro Aug 1, 2024
43ad9b1
Merge branch 'main' into integration/customer_support_workflow
vegaro Aug 1, 2024
dbd43aa
[Customer Center] Fix for disabled promo offer button (#4142)
vegaro Aug 2, 2024
6084a2c
Version 5.2.2-customercenter.alpha.3
vegaro Aug 2, 2024
7e9b355
[Customer Center] Fixes an extra blank screen after popping FeedbackS…
JayShortway Aug 6, 2024
e1b0cf4
[Customer Center] Improve subscription details view (#4152)
codykerns Aug 8, 2024
92db864
Customer Center compilation flag (#4149)
aboedo Aug 8, 2024
789d26a
Merge branch 'main' of github.com:RevenueCat/purchases-ios into integ…
tonidero Aug 8, 2024
c52f3cf
[Customer Center] UI polish for empty content (#4147)
codykerns Aug 8, 2024
3662879
[Customer Center] Use system navigation titles (#4161)
codykerns Aug 8, 2024
9284107
Disable `CustomerCenter` build flags (#4160)
tonidero Aug 9, 2024
759fd53
Fix compilation issues in older targets
tonidero Aug 9, 2024
ae44b59
Adds SemanticVersion
JayShortway Aug 9, 2024
52195fb
Revert "Disable `CustomerCenter` build flags (#4160)"
JayShortway Aug 9, 2024
f1e4da2
CustomerCenterViewModel checks whether the app is the latest version.
JayShortway Aug 12, 2024
9e943fa
Merge branch 'main' into check-latest-version
JayShortway Aug 12, 2024
08000e5
Cleanup
JayShortway Aug 12, 2024
9d5cffb
More cleanup.
JayShortway Aug 12, 2024
b11307b
Merge branch 'main' into check-latest-version
JayShortway Aug 13, 2024
dc1f795
CustomerCenterConfigResponse now provides lastPublishedAppVersion.
JayShortway Aug 13, 2024
be65640
Fixes CustomerCenterConfigDataTests.
JayShortway Aug 13, 2024
507d91c
Adds some more test cases.
JayShortway Aug 13, 2024
71171ac
Correctly (?) adds SemanticVersion to Xcode.
JayShortway Aug 13, 2024
5be6750
Fixes some warnings and adds the compiler flag to SemanticVersion[Tes…
JayShortway Aug 13, 2024
305d28e
Fixes a compile error.
JayShortway Aug 13, 2024
b9e241b
Fixes some warnings.
JayShortway Aug 13, 2024
50d7102
SemanticVersion only accepts UInts now.
JayShortway Aug 14, 2024
54c6ff6
appIsLatestVersion is initialized with defaultAppIsLatestVersion.
JayShortway Aug 14, 2024
8072747
Renames takeVersion to versionString.
JayShortway Aug 14, 2024
a64e6b4
Fixes a compilation error in SemanticVersionTests.
JayShortway Aug 14, 2024
385ab4e
defaultAppIsLatestVersion is static now.
JayShortway Aug 15, 2024
bbe3fca
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero Aug 9, 2024
7329cb6
Uses the existing SystemInfo.appVersion.
JayShortway Aug 15, 2024
19b7881
Uses a single guard let statement.
JayShortway Aug 15, 2024
1473222
Adds some more test cases.
JayShortway Aug 15, 2024
1ae81ea
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway Aug 15, 2024
d32e24a
Uses CFBundleShortVersionString directly.
JayShortway Aug 15, 2024
b72d05c
Fixes CustomerCenterConfigDataAPI.
JayShortway Aug 15, 2024
aae889a
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero Aug 9, 2024
1412b6b
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway Aug 15, 2024
0c2bdaa
Merge branch 'main' into check-latest-version
JayShortway Aug 15, 2024
a9d86ae
Removes references to non-existent ManageSubscriptionsButtonStyle.swi…
JayShortway Aug 15, 2024
e1854c0
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero Aug 9, 2024
d87b22f
Adds references to ButtonStyles.swift.
JayShortway Aug 15, 2024
469bc71
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero Aug 9, 2024
7ea9f06
Merge branch 'main' into ui-latest-version
JayShortway Aug 16, 2024
7402a25
Adds AppUpdateWarningView.
JayShortway Aug 16, 2024
9e38a87
CustomerCenterView shows AppUpdateWarningView when needed.
JayShortway Aug 16, 2024
a4519d9
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway Aug 16, 2024
ca983e0
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway Aug 16, 2024
a1ff1ad
Revert "Disable `CustomerCenter` build flags (#4160)"
tonidero Aug 9, 2024
b026b3a
Adds OpenAppStoreViewController.
JayShortway Aug 19, 2024
3df8a5b
Adds CUSTOMER_CENTER_ENABLED flag to OpenAppStoreViewController.
JayShortway Aug 19, 2024
d81da1d
Adds an initializer to AppUpdateWarningView which automatically opens…
JayShortway Aug 19, 2024
cb22b6e
CustomerCenterViewModel no longer handles opening the App Store.
JayShortway Aug 19, 2024
300a264
Adds productId fields to CustomerCenterConfigData and CustomerCenterC…
JayShortway Aug 19, 2024
310932e
CustomerCenterView provides the productId from CustomerCenterConfigur…
JayShortway Aug 19, 2024
b5724a0
Merge branch 'main' into ui-latest-version
JayShortway Aug 19, 2024
8d3cc5c
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 19, 2024
88ca98d
Revert "Revert "Disable `CustomerCenter` build flags (#4160)""
JayShortway Aug 19, 2024
e617f11
Add a descriptive comment.
JayShortway Aug 20, 2024
ce2d5bb
Merge branch 'main' into ui-latest-version
JayShortway Aug 20, 2024
cc98fc4
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 20, 2024
595a4b2
Correctly constructs CompatibilityContentUnavailableView using update…
JayShortway Aug 20, 2024
8d0fd2c
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 20, 2024
612ec19
Apply copy suggestions from code review
JayShortway Aug 20, 2024
e86ca2a
Uses .compatibleTopBarTrailing.
JayShortway Aug 20, 2024
eac6e3e
Adds an animation when navigating past the app update warning.
JayShortway Aug 20, 2024
0ff168f
Merge branch 'main' into ui-latest-version
JayShortway Aug 21, 2024
06f96da
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 21, 2024
bd11260
Ensures SKStoreProductParameterITunesItemIdentifier is an NSNumber.
JayShortway Aug 21, 2024
0f34733
AppUpdateWarningView opens the App Store directly.
JayShortway Aug 21, 2024
b8789c4
Deletes OpenAppStoreViewController.
JayShortway Aug 21, 2024
24e0f0f
Sets the correct field name in CustomerCenterConfigResponse and handl…
JayShortway Aug 21, 2024
d27f8a4
Updates a comment.
JayShortway Aug 21, 2024
d68c280
Fixes a constructor.
JayShortway Aug 21, 2024
5151ff0
Merge branch 'main' into ui-latest-version
JayShortway Aug 22, 2024
ce90f49
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 22, 2024
84cc70b
Restyles AppUpdateWarningView in line with the updated WrongPlatformV…
JayShortway Aug 22, 2024
928e6f8
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 22, 2024
191a41b
Fixes a test
JayShortway Aug 22, 2024
0d65d2b
Fixes a test again
JayShortway Aug 22, 2024
5a4e72d
Merge branch 'main' into ui-latest-version
JayShortway Aug 22, 2024
d8f45dc
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 22, 2024
54d6675
Merge branch 'main' into ui-latest-version
JayShortway Aug 22, 2024
6422533
Updates the dismiss button.
JayShortway Aug 22, 2024
68ce39a
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 22, 2024
acb4f68
Updates the copy.
JayShortway Aug 26, 2024
5e3bebe
Updates the icon.
JayShortway Aug 26, 2024
38af427
Merge branch 'main' into ui-latest-version
JayShortway Aug 26, 2024
7cffeb6
Merge branch 'ui-latest-version' into open-app-store
JayShortway Aug 26, 2024
33acfb0
Merge branch 'main' into open-app-store
JayShortway Aug 27, 2024
a55224e
Safely unwraps configuration.productId.
JayShortway Aug 27, 2024
7398e53
Removes an accidental redecleration after a merge.
JayShortway Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ enum CustomerCenterConfigTestData {
]
),
support: .init(email: "test-support@revenuecat.com"),
lastPublishedAppVersion: lastPublishedAppVersion
lastPublishedAppVersion: lastPublishedAppVersion,
productId: 1
)
}

Expand Down
15 changes: 15 additions & 0 deletions RevenueCatUI/CustomerCenter/Views/AppUpdateWarningView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ struct AppUpdateWarningView: View {
let onUpdateAppClick: () -> Void
let onContinueAnywayClick: () -> Void

init(onUpdateAppClick: @escaping () -> Void, onContinueAnywayClick: @escaping () -> Void) {
self.onUpdateAppClick = onUpdateAppClick
self.onContinueAnywayClick = onContinueAnywayClick
}

init(productId: UInt, onContinueAnywayClick: @escaping () -> Void) {
self.init(
onUpdateAppClick: {
// productId is a positive integer, so it should be safe to construct a URL from it.
UIApplication.shared.open(URL(string: "https://itunes.apple.com/app/id\(productId)")!)
},
onContinueAnywayClick: onContinueAnywayClick
)
}

@Environment(\.localization)
private var localization: CustomerCenterConfigData.Localization
@Environment(\.appearance)
Expand Down
10 changes: 5 additions & 5 deletions RevenueCatUI/CustomerCenter/Views/CustomerCenterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ private extension CustomerCenterView {
if viewModel.hasSubscriptions {
if viewModel.subscriptionsAreFromApple,
let screen = configuration.screens[.management] {
if ignoreAppUpdateWarning || viewModel.appIsLatestVersion {
ManageSubscriptionsView(screen: screen,
customerCenterActionHandler: viewModel.customerCenterActionHandler)
} else {
if let productId = configuration.productId, !ignoreAppUpdateWarning && !viewModel.appIsLatestVersion {
AppUpdateWarningView(
onUpdateAppClick: { viewModel.onAppUpdateClick() },
productId: productId,
onContinueAnywayClick: {
withAnimation {
ignoreAppUpdateWarning = true
}
}
)
} else {
ManageSubscriptionsView(screen: screen,
customerCenterActionHandler: viewModel.customerCenterActionHandler)
}
} else {
WrongPlatformView()
Expand Down
6 changes: 5 additions & 1 deletion Sources/CustomerCenter/CustomerCenterConfigData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ public struct CustomerCenterConfigData {
public let localization: Localization
public let support: Support
public let lastPublishedAppVersion: String?
public let productId: UInt?

public init(screens: [Screen.ScreenType: Screen],
appearance: Appearance,
localization: Localization,
support: Support,
lastPublishedAppVersion: String?) {
lastPublishedAppVersion: String?,
productId: UInt?) {
self.screens = screens
self.appearance = appearance
self.localization = localization
self.support = support
self.lastPublishedAppVersion = lastPublishedAppVersion
self.productId = productId
}

public struct Localization {
Expand Down Expand Up @@ -345,6 +348,7 @@ extension CustomerCenterConfigData {
})
self.support = Support(from: response.customerCenter.support)
self.lastPublishedAppVersion = response.lastPublishedAppVersion
self.productId = response.itunesTrackId
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct CustomerCenterConfigResponse {

let customerCenter: CustomerCenter
let lastPublishedAppVersion: String?
let itunesTrackId: UInt?

struct CustomerCenter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class CustomerCenterConfigDataTests: TestCase {
localization: .init(locale: "en_US", localizedStrings: ["key": "value"]),
support: .init(email: "support@example.com")
),
lastPublishedAppVersion: "1.2.3"
lastPublishedAppVersion: "1.2.3",
itunesTrackId: 123
)

let configData = CustomerCenterConfigData(from: mockResponse)
Expand Down Expand Up @@ -139,6 +140,7 @@ class CustomerCenterConfigDataTests: TestCase {
}

expect(configData.lastPublishedAppVersion) == "1.2.3"
expect(configData.productId) == 123
}

}
Expand Down