Skip to main content
Solved

Should getCustomerInfo() return Family Sharing subscription status?


Forum|alt.badge.img+2

The below Swift code works for authenticating subscribed purchases but does not always work for family sharing (Family Sharing is recognized by Apple but revenueCatManager.isSubscriptionActive returns false).

Purchases.shared.getCustomerInfo { (customerInfo, error) in
                if customerInfo?.entitlements.all["Regular"]?.isActive == true {
                    revenueCatManager.isSubscriptionActive = true
                    let purchasedProductSet = customerInfo?.activeSubscriptions
                    for purchasedProduct in purchasedProductSet! {
                        product_id += purchasedProduct
                    }
                    let expireRenewalDate = customerInfo?.expirationDate(forEntitlement: "Regular") ?? Date()
                    let formatter = DateFormatter()
                    formatter.dateFormat = "MMM d, y"//"EEEE, MMMM d, yyyy h:mm:ss a zzzz"
                    renewalDate = formatter.string(from: expireRenewalDate)
                } else {
                    revenueCatManager.isSubscriptionActive = false
                }
            }

Best answer by ryan

Hey @Peter Bonac

For Family Shared purchases, the customer may need to `.restoreTransactions()` to sync the device receipt with RevenueCat and unlock access. 

Calling getCustomerInfo() checks the server-side subscription status from RevenueCat and is not directly reading the device receipt. 

View original
Did this post help you find an answer to your question?
This post has been closed for comments

3 replies

ryan
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 391 replies
  • Answer
  • November 4, 2022

Hey @Peter Bonac

For Family Shared purchases, the customer may need to `.restoreTransactions()` to sync the device receipt with RevenueCat and unlock access. 

Calling getCustomerInfo() checks the server-side subscription status from RevenueCat and is not directly reading the device receipt. 


Forum|alt.badge.img+2
  • Author
  • New Member
  • 1 reply
  • November 7, 2022

Hi @ryan, thank you for the info. 

It was my understanding that checking the “server-side subscription status from RevenueCat” every time someone opens the app is the proper approach. Is this not the case?


ryan
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 391 replies
  • November 7, 2022

Hey Peter,

Your approach is correct, but those customers with a Family Shared subscriptions will need to restore purchases once to let RevenueCat know to unlock access. 


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