How to Share in App Purchases With Family Sharing

What is Family Sharing?

Family Sharing is a characteristic in Apple platforms that allows users to share digital purchases with members of their family — purchases like movies, books, TV shows, and even apps.

It's been around for a few years now, but until recently app sharing was limited to purchases of entire apps, not in-app purchases.

So if an app was free to download just offered a subscription as an in-app purchase, the subscription wouldn't be shareable, even if the Family Sharing badge was displayed on the App Store page. Users who purchased a subscription might feel deceived and blame the app developers.

This changed in December 2020. At present, Apple allows users to share in-app purchases, including subscriptions, with family members. Since then, many apps take started using Family Sharing for subscriptions.

In this post, nosotros'll talk about how Family Sharing works, how to back up and exam information technology, and a few of the benefits and drawbacks of enabling Family Sharing for your app.

How Family Sharing works

Users tin can ready an iCloud Family account to share in-app purchases with up to 6 people.

The "Share with Family" pick can be found in the Settings app on iOS or macOS, or on icloud.com. Users tin can choose to share all of their shareable subscriptions with their family, or select specific private subscriptions to share.

A notation most compatibility:

  • Only not-consumables and subscriptions can be shared. Which makes sense — you don't want a customer who bought a consumable for 50 coins to finer get 300 coins if they share that purchase with their family.
  • Shared purchases work on older iOS and macOS versions. However, only more recent versions of macOS and iOS have a UI that supports managing shared subscriptions — tvOS and watchOS don't take this yet.

Enabling Family Sharing for your app

It'due south pretty piece of cake to showtime supporting Family Sharing for in-app purchases. Only go into App Store Connect, observe the production you'd like to brand Family Shareable (or create i), and turn on Family Sharing. It'due south enabled on a per-production footing.

Note: In one case Family Sharing is enabled for a given production, information technology tin can't be disabled. This is so that if a user purchases a subscription for their entire family, the subscription won't of a sudden stop working for their family members and effectively be less valuable to them than when they purchased it.

Once Family Sharing is enabled, existing subscribers who accept a family set up in iCloud will get a notification letting them know that they can at present share the subscription with their family members.

Notation: Yous should brand sure that your paywall clearly states that a subscription tin be shared with family members, since this might exist very valuable to users. You can apply the new property isFamilyShareable in SKProduct to selectively display an extra callout and explain the benefits of sharing the subscription.

Setting up support for Family Sharing with in-app purchases

Enabling Family Sharing in App Shop Connect seems easy plenty, but how most actually supporting information technology?

The good news is, you don't accept to exercise annihilation special to support Family Sharing for in-app purchases! 🎉

Apple designed Family Sharing for in-app purchases in such a fashion that nigh apps can back up a bare-minimum implementation without having to touch any lawmaking. However, if you want to cover all utilize cases and provide the best possible feel for your users, you'll have to make a few updates.

A couple of things to consider:

  • How to grant your users access to the content and revoke access when necessary
  • How you'll calculate acquirement

Granting and revoking admission

When a user starts sharing a purchase (either because they just enabled Family Sharing for an existing purchase or because they just bought a shareable production), a purchase will be added to the transaction queue for each of their family unit members.

In order to provide the content to your users, you lot should make sure to observe the transaction queue as early as possible within your app flow. Once the transaction comes in, validate it with the /verifyReceipt endpoint and enable the content for the users.

Apple introduced a new API to the SKPaymentTransactionObserver for Family Sharing chosen paymentQueue(_:didRevokeEntitlementsForProductIdentifiers:).

This method is called when a shared purchase is no longer bachelor to the user (for instance, if a user leaves the iCloud family unit to showtime their own, or sharing is disabled for a purchase).

When this method is called, you lot should revoke access to the purchase for the current user. The purchase will also show up equally expired in /verifyReceipt (run across our post on how to read the receipts), so if a user doesn't open the app, y'all can notwithstanding revoke access when refreshing receipts.

When a user purchases a new subscription with Family unit Sharing enabled, information technology won't bear witness up on their family members' devices right away. It takes virtually 60 minutes from when the buy is made for the subscription to go available to other family unit members. This is intentional — information technology's meant to give the purchaser time to decide whether they actually want to share the subscription (eastward.grand., if they subscribe to an app that contains content they might non want to share with their kids).

However, this delay only happens for new purchases, not renewals. If a user has already purchased a subscription and after turns on Family unit Sharing, in that location won't be a delay. The supposition is that at this point the user has fabricated it clear that they actually intend to share access.

Calculating acquirement

If you're computing your app's revenue from in-app purchases, you'll demand to make certain that you're only counting family-shared transactions from the user who made the buy, non their family members. Otherwise yous might cease up with a revenue number many times higher than what you actually made from that purchase.

When a user buys a Family unit Shareable in-app purchase, it volition bear witness up on their receipt as usual. However, the receipt will now include a new field called in_app_ownership_type with the value PURCHASED.

A new transaction will also be added to the queue for all their family members. The transaction will accept a new web_order_line_item_id and original_transaction_id, as well as in_app_ownership_type with the value FAMILY_SHARED.

In order to accurately calculate revenue, brand sure you but count transactions with in_app_ownership_type = PURCHASED.

Note: You don't need to copy the user's family structure on your backend. In fact, this is difficult to do by design (to protect user privacy), and re-creating the user'south family structure doesn't provide any benefit.

Once you have the receipts, the rest of the process should be familiar: refreshing receipts, keeping track of expiration dates, and and so on.

Providing the best user experience

If you've followed along so far, your app should at present exist set up to grant Family unit Sharing access and rails analytics. But in that location'due south one more use example that you should consider in order to provide the all-time experience for your users.

When a user makes a buy in your app, they usually go through a paywall that details all of the benefits that they'll get by making the buy. Some apps even show a tutorial for how to take reward of the newly-unlocked content.

But family unit members that are granted shared access to an app never encounter the paywall, so they may not understand the value of the product. For example, let's say you're selling a Pro subscription, which unlocks access to specific features in your app. A family member may open up the app with Pro access already unlocked and never know what exclusive features they take access to.

Fortunately, in that location'due south a style to brainwash users nearly the benefits of a purchase that has been shared with them. Use the in_app_ownership_type field from /verifyReceipt to let them know that a family member shared Pro access with them and what features they'll leave of it.

If you're using Introductory Pricing, when y'all calculate eligibility for users, you lot'll demand to make sure that y'all're accounting for shared purchases as well. Luckily this part should be like shooting fish in a barrel: just make sure that FAMILY_SHARED transactions aren't filtered out when calculating eligibility — if a family member has already taken advantage of intro pricing and shared it with their family, their family members shouldn't exist eligible for that intro pricing in the future.

Testing shared subscriptions

Sadly, Family unit Sharing doesn't piece of work in the Sandbox environment. So at that place'due south no real way to test it, other than trying it out in Production.

The closest you can become is to false a like-looking scenario so you get a new transaction to show upwards in the payment queue. For example:

  • Buy a subscription.
  • Allow it expire naturally.
  • Go to Settings > App Store > Sandbox Account > Manage Subscriptions > and subscribe once more.

This will generate a new transaction that shows up in the queue as presently as y'all re-open the app (which is like to what happens when a family member shares a subscription with you). This flow volition only help you lot test that yous're correctly subscribing to the queue and won't miss events, merely the receipts here won't have the in_app_ownership_type set to FAMILY_SHARED.

Unfortunately, at that place's no way to test the scenario where a user's subscription is revoked. Simply brand certain that you're subscribing to the payment queue and that paymentQueue(_:didRevokeEntitlementsForProductIdentifiers:) is implemented correctly.

Enabling Family Sharing with RevenueCat

Of course, you can always accept the easy route and let us do the work for you!

If you're already a RevenueCat customer, Family Sharing is automatically supported for your in-app purchases. Once you gear up them up in App Store Connect, Analytics and Entitlements will automatically work as expected.

All you need to exercise is:

  • Initialize the SDK as early as possible in your app period so that transactions in the queue are detected right away.
  • In purchases-ios >= three.11.0, use the new ownership_type field in EntitlementInfo to determine whether an Entitlement was granted to a user through a direct purchase or Family Sharing, and so brainwash users on the benefits of the in-app purchase.
  • Use SKProduct'due south isFamilyShareable to selectively display a callout on your paywall notifying users that a given subscription tin be shared with their family members. This is available through the Package in each Offer.
  • To check eligibility for introductory prices, apply our API but like you usually would.

coleclowed54.blogspot.com

Source: https://www.revenuecat.com/blog/apple-family-sharing

0 Response to "How to Share in App Purchases With Family Sharing"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel