Add RevenueCatBackupAgent#2625
Conversation
fad6c36 to
36a54ab
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2625 +/- ##
==========================================
- Coverage 78.53% 78.47% -0.06%
==========================================
Files 304 305 +1
Lines 11362 11375 +13
Branches 1577 1577
==========================================
+ Hits 8923 8927 +4
- Misses 1749 1758 +9
Partials 690 690 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…dd-revenuecat-proactive-backup-agent
1f36912 to
c88152b
Compare
There was a problem hiding this comment.
I think there is a typo in the filename api-defauts.txt -> api-defaults.txt?
There was a problem hiding this comment.
Will do this in a separate PR, since it could cause conflicts otherwise. Good catch!
RevenueCatProactiveBackupAgentRevenueCatBackupAgent
| } | ||
|
|
||
| @Test | ||
| fun `login called with different appUserID notifies backup manager`() { |
There was a problem hiding this comment.
maybe we need a test for logout as well?
There was a problem hiding this comment.
I kinda reused the existing logout called with identified user makes right calls test, which tests a few things... Might be worth splitting up in multiple tests, but I think that might be better to do on a separate PR?
### Description This PR adds a new `RevenueCatBackupAgent` that consumers of this library can optionally use to backup revenuecat data accross installations. To use it, developers need to add this in the application's AndroidManifest `<application>` tag: ``` android:backupAgent="com.revenuecat.purchases.backup.RevenueCatBackupAgent" ``` After that, the shared preferences file with the main content from RevenueCat will be saved using the device's backup system. See official docs for this type of backup here: https://developer.android.com/identity/data/keyvaluebackup. If users already have their own BackupAgentHelper configured for their app, they can just add a line to backup the `com_revenuecat_purchases_preferences` preferences file to their BackupAgentHelper, like: ``` SharedPreferencesBackupHelper(this, RevenueCatBackupAgent.REVENUECAT_PREFS_FILE_NAME).also { addHelper("revenuecat_prefs_backup", it) } ``` This will allow customers, specially for apps using anonymous users, to immediately regain access to any entitlements they had before changing devices or uninstalling and reinstalling, effectively removing the need for these users to "restore purchases".
**This is an automatic release.** ## RevenueCat SDK ### ✨ New Features * Add `RevenueCatBackupAgent` (#2625) via Toni Rico (@tonidero) ### 🔄 Other Changes * Fix CoroutineCreationDuringComposition lint error on AGP 8.13.0 (#2659) via Cesar de la Vega (@vegaro) * Support setting null offering id on PaywallView (#2658) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Description
This PR adds a new
RevenueCatBackupAgentthat consumers of this library can optionally use to backup revenuecat data accross installations. To use it, developers need to add this in the application's AndroidManifest<application>tag:After that, the shared preferences file with the main content from RevenueCat will be saved using the device's backup system. See official docs for this type of backup here: https://developer.android.com/identity/data/keyvaluebackup.
If users already have their own BackupAgentHelper configured for their app, they can just add a line to backup the
com_revenuecat_purchases_preferencespreferences file to their BackupAgentHelper, like:This will allow customers, specially for apps using anonymous users, to immediately regain access to any entitlements they had before changing devices or uninstalling and reinstalling, effectively removing the need for these users to "restore purchases".