Skip to main content
Solved

Family subscription does not update CustomerInfo

  • 19 March 2022
  • 1 reply
  • 97 views

Forum|alt.badge.img+3

My iOS SwiftUI app has 2 subscription options: Individual and Family. The level of access is the same, the only difference is that Family enables family sharing.

Because the package length cannot be the same for multiple packages, I worked around it by having the Individual subscription on a RC standard Annual length, and Family subscription on a custom length (for more on that, see my other post).

Everything seemed to work fine, but recently (RC update?) I started having the following problem with the Family subscription.

When a user purchases a subscription, I expect the following subscriptionActive value to update, as per RC documentation and sample apps:

class UserViewModel: NSObject, ObservableObject {

   static let shared = UserViewModel()

  @Published var subscriptionActive: Bool = false

  @Published var customerInfo: CustomerInfo? {

      didSet {

        subscriptionActive = customerInfo?.entitlements[Constants.entitlementID]?.isActive == true

      }

  }

I could just check if subscriptionActive to control what content to show.

However, the value now ONLY updates when the Individual subscription is purchased (or restored). When the Family subscription is purchased (or restored), subscriptionActive remains FALSE, and the app subsequently behaves as if nothing was purchased. Meanwhile, the App Store sandbox account correctly shows the Family subscription.

Any ideas would be very helpful!

Best answer by Jan Stehlik

Ok, after some testing, I found that the value actually does set! So after a bit more digging, I realized that Constants.entitlementID is a simple String that only contains the id of the Individual subscription entitlement. An easy fix added a second value for the family entitlement, and it now works. Yey!

View original
Did this post help you find an answer to your question?

1 reply

Forum|alt.badge.img+3
  • Author
  • Helper
  • 3 replies
  • Answer
  • March 19, 2022

Ok, after some testing, I found that the value actually does set! So after a bit more digging, I realized that Constants.entitlementID is a simple String that only contains the id of the Individual subscription entitlement. An easy fix added a second value for the family entitlement, and it now works. Yey!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings