You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For certain versions of iOS under certain conditions iOS can prewarm apps. RevenueCat writes about this in the documentation. There's also some community discussion.
The documentation only writes about issues when not using anonymous identifiers. But the problem scope is bigger. When an app is launched for prewarming, access to the file system is not possible, which includes UserDefaults (which are used by RevenueCat during the configuration).
This resulted in end users reporting losing access (they lost entitlements and got a new anonymous ID) after a reboot until they restored purchases. I fixed with a workaround of detecting the prewarming state and in this case configuring RevenueCat later. But as prewarming will only get more common with the popularity of live activities and the dynamic island a mission critical SDK like RevenueCat should mitigate this internally. Most developers don't know about prewarming and the behavior of completeFileProtectionUntilFirstUserAuthentication, which is the default for most files. So this results in very difficult bugs and frustrated end users.
Environment
Platform: iOS
SDK version: 5.14.3
StoreKit version:
StoreKit 1 (default on versions <5.0.0. Can be enabled in versions >=5.0.0 with .with(storeKitVersion: .storeKit1))
StoreKit 2 (default on versions >=5.0.0)
OS version: iOS 18.1.1
Xcode version: 16.1
Device and/or simulator:
Device
Simulator
Environment:
Sandbox
TestFlight
Production
How widespread is the issue. Percentage of devices affected.
Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.
I can't access logs as it's not available, when iOS does prewarming while the device is locked after the reboot.
Steps to reproduce, with a description of expected vs. actual behavior
Create a sample app with a live activity for the lock screen / dynamic island and add RevenueCat SDK
Configure Purchases in AppDelegate init or didFinishLaunchingWithOptions
Run app and schedule live activity, lock device and allow live activities on the lock screen
Reboot device
Wait up to 60 sec while locked after reboot
Unlock device
Open sample app
Expected: RevenueCat and UserDefaults works normally
Actual: All UserDefaults.standard accesses return wrong values resulting in all kinds of other potential issues, RevenueCat cache is returning wrong values
I made a sample here that still needs adjustment to use and configure RevenueCat.
Describe the bug
For certain versions of iOS under certain conditions iOS can prewarm apps. RevenueCat writes about this in the documentation. There's also some community discussion.
The documentation only writes about issues when not using anonymous identifiers. But the problem scope is bigger. When an app is launched for prewarming, access to the file system is not possible, which includes UserDefaults (which are used by RevenueCat during the configuration).
This resulted in end users reporting losing access (they lost entitlements and got a new anonymous ID) after a reboot until they restored purchases. I fixed with a workaround of detecting the prewarming state and in this case configuring RevenueCat later. But as prewarming will only get more common with the popularity of live activities and the dynamic island a mission critical SDK like RevenueCat should mitigate this internally. Most developers don't know about prewarming and the behavior of
completeFileProtectionUntilFirstUserAuthentication
, which is the default for most files. So this results in very difficult bugs and frustrated end users..with(storeKitVersion: .storeKit1)
)Purchases.logLevel = .verbose
will help us debug this issue.I can't access logs as it's not available, when iOS does prewarming while the device is locked after the reboot.
Expected: RevenueCat and UserDefaults works normally
Actual: All UserDefaults.standard accesses return wrong values resulting in all kinds of other potential issues, RevenueCat cache is returning wrong values
I made a sample here that still needs adjustment to use and configure RevenueCat.
pointfreeco/swift-composable-architecture#3440
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: