Skip to main content
Answer

Should getCustomerInfo() return Family Sharing subscription status?

  • November 2, 2022
  • 3 replies
  • 140 views

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. 

This post has been closed for comments

3 replies

ryan
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 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
  • 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
  • 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.