Apple Family Sharing
Learn how to check whether a product is eligible for Apple Family Sharing and how to register a handler that triggers when entitlements are revoked, such as when a family member later loses access to that shared purchase.
Read time 1 minuteLast updated 4 months ago
Apple supports Family Sharing for auto-renewable subscriptions and non-consumable in-app purchases. To use Family Sharing, enable it for each product individually in App Store Connect. For set up instructions, refer to Turn on Family Sharing for In-App Purchases.
Family Sharing eligibility
Use the field in the Apple product metadata to check whether a product is shareable. Call to access this metadata.
isFamilyShareableProduct.ProductMetadata.GetAppleProductMetadata()bool IsProductFamilyShareable(Product product) { var appleProductMetadata = product.metadata.GetAppleProductMetadata(); return appleProductMetadata?.isFamilyShareable ?? false; }
Revoked entitlements
Your app needs to handle cases where a family member loses access to a shared purchase. To do this, add a listener for IAppleStoreExtendedPurchaseService.OnEntitlementRevoked by using .
StoreController.AppleStoreExtendedPurchaseServiceThis event is raised when Apple revokes access to a product. It passes the revoked product ID to your listener so your app can update access accordingly. Losing access to a shared purchase is just one of the potential scenarios that might trigger this event.
Use the following sample to register a listener for entitlement revocation events to receive the product ID when Apple revokes access to a purchase.
void AddAppleListeners(){ var applePurchaseService = UnityIAPServices.StoreController().AppleStoreExtendedPurchaseService; if (applePurchaseService != null) { applePurchaseService.OnEntitlementRevoked += EntitlementRevokedListener; }}void EntitlementRevokedListener(string productId){ Debug.Log($"Revoked product: {productId}");}