Skip to main content

https://github.com/RevenueCat/purchases-ios/issues/1527

As mentioned here, the workaround suggest  us to separate the `Userdefaults`.

I would like to ask how to migrate the already cached data to the new `Userdefaults`. Because once we do that when we call `Purchases.shared.getCustomerInfo` we won't get the `CustomerInfo`(data not cached in new `Userdefaults`).

@Floating island Did you end up with a solution for this?

I’m thinking it’s possible to migrate like so:

for entry in UserDefaults.standard.dictionaryRepresentation() {
let (key, value) = entry

if key.starts(with: "com.revenuecat.") {
UserDefaults.group.set(value, forKey: key)
}
}

Is there somebody from RevenueCat who can confirm this is a reasonable approach? Or someone in the community who has done this already? 


Reply