Skip to content

Commit 947d0a7

Browse files
[ObserverMode] How to get/import historic subscriptions doc update/guide (#907)
* added new sync past subscriptions setting * Added import/migrate in bulk to the past subs sync
1 parent 70d68e7 commit 947d0a7

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

docs/migrating-to-revenuecat/sdk-or-not/finishing-transactions.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,57 @@ import om7 from "@site/code_blocks/migrating-to-revenuecat/observer-mode_7.js.tx
5656
},
5757
]}
5858
/>
59+
60+
## Syncing Past Subscriptions
61+
62+
When using RevenueCat with your own IAP code, historical subscriptions won't automatically appear in the dashboard. To sync past subscriptions, you'll need to call `syncPurchases()` after configuring the SDK. This method will:
63+
64+
- read the local App Store receipt (iOS) or query the billing library (Android) for existing transactions
65+
- process historical transactions and associate them with the current appUserID
66+
- activate entitlements and display the data in the dashboard
67+
68+
:::info Best Practice
69+
Call `syncPurchases()` after a user logs in, rather than on every app launch. Calling it too frequently can cause unnecessary delays or disrupt the user experience, especially if your app has a large user base or complex entitlements.
70+
:::
71+
72+
:::warning Limitations of syncPurchases()
73+
`syncPurchases()` only brings in data if the customer opens the app. Anyone inactive won't be included until they return. Additionally:
74+
75+
- On iOS, it only processes what's still in the local App Store receipt
76+
- On Android, it only queries the BillingClient for currently owned subscriptions or non-consumed purchases
77+
- It does not pull in all historical orders ever made on the store account — just what's currently accessible on that device/session
78+
:::
79+
80+
### Alternative Approaches for Historical Data
81+
82+
If you need to backfill past subscriptions without depending on users launching the updated app, consider these alternative approaches:
83+
84+
1. **Backend Import**: Use our [Migration to RevenueCat](/migrating-to-revenuecat/migration-paths) guide to implement a server-side migration. This approach:
85+
86+
- Allows you to send Apple receipts or Google purchase tokens directly to RevenueCat using the `POST /receipts` [API reference](https://www.revenuecat.com/docs/api-v1#tag/transactions/operation/receipts).
87+
- Gives you complete control and can be scripted to run once or continuously
88+
- Is ideal for fully backfilling past subscriptions
89+
<br />
90+
> **Note**: The API has rate limits, so for large-scale migrations,
91+
consider implementing bulk processing with appropriate delays between
92+
batches.
93+
<br />
94+
For more details on importing historical purchases, see our [Importing your
95+
Historical
96+
Purchases](/migrating-to-revenuecat/migrating-existing-subscriptions)
97+
guide.
98+
99+
2. **Google Historical Import**: For Google Play apps, we offer a specialized [Google Historical Import](/migrating-to-revenuecat/migrating-existing-subscriptions/google-historical-import) process that:
100+
- Overcomes the 90-day token expiry limitation
101+
- Captures a deeper purchase history
102+
- Requires additional setup with Google Play Console
103+
104+
:::warning Amazon
105+
For Amazon Appstore apps, you'll need to manually sync each purchase using `syncAmazonPurchase()` after making a purchase. See our [Amazon Platform Resources](/platform-resources/amazon-platform-resources#syncing-purchases-when-your-app-is-completing-transactions) for more details.
106+
:::
107+
108+
### Restore Behavior Considerations
109+
110+
When syncing purchases, RevenueCat will handle existing subscriptions based on your [restore behavior](/projects/restore-behavior) setting. This setting determines what happens when a user's purchases are already associated with a different App User ID.
111+
112+
For more information about restoring purchases and best practices, see our [Restoring Purchases](/getting-started/restoring-purchases) guide.

0 commit comments

Comments
 (0)