StoreKit 2: how can we test Family Sharing?

I'm not a member of any Family in iCloud. I want to understand what happens when a user is subscribed through Family Sharing but also how to use StoreKit when the user is subscribed twice: as an individual who purchased the product and as a member of a family when the purchase is shared with him.

How can I test Family Sharing for an app offering a product with Family Sharing enabled? Is it possible to create a fake Family in App Store Connect and add testers to it?

Replies

Please watch our tech talk for more info on how the Family Sharing for in app purchases feature works and learn some best practices. In general users of your app (the purchaser or family member) are nearly identical outside of the transaction value ownership type. What is important is your app is always monitoring for new transaction upon app launch. If so, your pp will see an unfinished transaction for you to process and grant access. To test that, be sure you can handle interrupted purchases.

Tech talk: https://developer.apple.com/videos/play/tech-talks/10869/

Testing interrupted purchases: https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_in-app_purchases_with_sandbox/testing_an_interrupted_purchase

  • Thanks, I'll have a look!

    Basically, I want to show in my app if a user is already subscribed to the individual plan or the family plan, and in the case of the family plan, if he's the owner or not.

    In the case where a user is subscribed twice, when using the status Instance Property on Product.SubscriptionInfo, we will have at least two statuses. It's our job to make sure we offer the higher level of service. But are all the information provided in a single status specific to a subscription? For example, are the renewalInfo related to the individual plan or the family plan? Can we know that? Same for the transaction in the https://developer.apple.com/documentation/storekit/product/subscriptioninfo/status/3822294-renewalinfo?

    Also, it seems possible to access the latestTransaction for the individual product and also the latestTransaction for the family product.

Add a Comment

Specifically you can identify the source of the transaction using the in app ownership key available from VerifyReceipt or any JWS transaction. It will indicate if the customer has it due to their own purchase or if it was via family sharing for in-app purchase.