mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-24 08:42:18 +00:00
Fix purchased features on Apple TV (#1083)
Refactor #1074 to show the appropriate list of eligible features in the "Purchased" screen. The "X" signs are highly misleading.
This commit is contained in:
parent
66da9d165d
commit
7ecd37e6ba
@ -35,7 +35,26 @@ extension AppProduct: AppFeatureProviding {
|
|||||||
return AppFeature.allCases
|
return AppFeature.allCases
|
||||||
|
|
||||||
case .Features.appleTV:
|
case .Features.appleTV:
|
||||||
|
#if os(tvOS)
|
||||||
|
// treat .appleTV as full version on tvOS to cope
|
||||||
|
// with BuildProducts limitations
|
||||||
|
//
|
||||||
|
// some old iOS/macOS users are acknowledged certain
|
||||||
|
// purchases based on the build number of their first
|
||||||
|
// download, e.g. "Full version (iOS)". unfortunately,
|
||||||
|
// that build number is not the same on tvOS, so
|
||||||
|
// those purchases do not exist and the TV may complain
|
||||||
|
// about missing features other than .appleTV
|
||||||
|
//
|
||||||
|
// we avoid this by relying on iOS/macOS eligibility
|
||||||
|
// alone while only requiring .appleTV on tvOS
|
||||||
|
//
|
||||||
|
// this is a solid workaround as long as profiles are
|
||||||
|
// not editable on tvOS
|
||||||
|
return AppFeature.allCases
|
||||||
|
#else
|
||||||
return [.appleTV, .sharing]
|
return [.appleTV, .sharing]
|
||||||
|
#endif
|
||||||
|
|
||||||
// MARK: Discontinued
|
// MARK: Discontinued
|
||||||
|
|
||||||
|
@ -48,10 +48,6 @@ extension IAPManager {
|
|||||||
guard isEligible(for: .appleTV) else {
|
guard isEligible(for: .appleTV) else {
|
||||||
throw AppError.ineligibleProfile([.appleTV])
|
throw AppError.ineligibleProfile([.appleTV])
|
||||||
}
|
}
|
||||||
// require only .appleTV to cope with BuildProducts
|
|
||||||
// rely on iOS/macOS eligibility as profiles are not
|
|
||||||
// editable on tvOS
|
|
||||||
return
|
|
||||||
#endif
|
#endif
|
||||||
let requiredFeatures = features.filter {
|
let requiredFeatures = features.filter {
|
||||||
!isEligible(for: $0)
|
!isEligible(for: $0)
|
||||||
|
Loading…
Reference in New Issue
Block a user