RevenueCat/purchases-ios

Bug: Writing Keys out of container

Closed this issue · 7 comments

Describe the bug
A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

  1. Environment
    1. Platform: iOS
    2. SDK version: 4.41.2
    3. StoreKit version:
      • StoreKit 1
      • StoreKit 2 (enabled with usesStoreKit2IfAvailable(true))
    4. OS version: 17.4.1
    5. Xcode version: 15.2
    6. Device and/or simulator:
      • Device
      • Simulator
    7. Environment:
      • Sandbox
      • TestFight
      • Production
    8. How widespread is the issue. Percentage of devices affected. 100%
  2. Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.
rejecting write of key(s) com.revenuecat.userdefaults.subscriberAttributes in { appGroup.com, mobile, kCFPreferencesAnyHost, /var/mobile/Containers/Shared/AppGroup/2814C7B7-ED2A-49EA-96E8-61F76DFF7F68/Library/Preferences/appGroup.com, managed: 0 } from process 687 () because setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access	cfprefsd
  1. Steps to reproduce, with a description of expected vs. actual behavior

Install an app with an extension, use purchases in extension.

  1. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

  2. Additional context
    Add any other context about the problem here.

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@jesus-mg-ios looks like this is an error concerning user defaults, are you specifying your own user defaults or using the standard one? Can you share the debug logs and a code snippet for us to look into?

I'm specifying mine

 var configuration = Configuration.Builder(withAPIKey: KEY).with(appUserID: USERID)
 if let defaults = UserDefaults(suiteName: appGroup) {
      configuration = configuration.with(userDefaults: defaults)
 } 
 Purchases.configure(with: configuration.build())

Hey @jesus-mg-ios,
Apologies for the delay. That code looks fine. Are you running on macOS or iOS? And can you share the debug logs that reproduce this? You can check this guide for how to enable debug logging: https://www.revenuecat.com/docs/test-and-launch/debugging

Hi @jesus-mg-ios,
Since there haven't been any updates to this issue I'm going to close it but if you're still having this issue then please feel free to reopen it and we can continue the investigation.

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.