Hey everyone, I have two questions regarding the i...
# ask-questions
l
Hey everyone, I have two questions regarding the iOS SDK: 1. Does GrowthBook automatically cache feature payloads on disk? If yes, how long does the cache last by default, and is it possible to disable it or change the duration? 2. When using the SDK only for feature flags, does GrowthBook collect any user data (e.g., IP address or device identifiers) that I should declare in App Store Connect? Thanks!
c
Hi @lively-evening-1890. Please let us check that and we will write to you.
Here are the details on how the GrowthBook Swift SDK handles caching and data: 1. Caching Feature Payloads Yes, the GrowthBook Swift SDK automatically caches feature payloads in local storage. The cache persists until it is refreshed. This refresh happens automatically when features are fetched again (e.g., on the next app launch or when refresh is triggered). You can also manually force the cache to be cleared by calling the
clearCache()
method.1 Currently, it is not possible to disable this caching behavior or configure a specific duration. The cache is simply considered "current" based on the last successful fetch. More about caching you can read in our docs. 2. User Data Collection No, when used for feature flags, the SDK does not automatically collect any user data like IP addresses or device identifiers that you would typically need to declare in App Store Connect. The SDK only processes data that you explicitly pass to it. For example, you are in full control of the targeting attributes you send when initializing the SDK or setting user attributes:
Copy code
// You decide exactly what data to send.
// The SDK does not add anything automatically.
let attributes: [String: Any] = [
    "id": "user_123",
    "email": "user@example.com", 
    "country": "US"
]
growthbook.setAttributes(attributes)
In summary, the SDK only handles the feature definitions (rules, default values, etc., which you control in your dashboard) and the targeting attributes that you provide. It does not perform any automatic tracking or collection of personal user or device data. Hope this helps clarify things!
👍 1
l
Thank you so much! It helped me a lot.
🙌 1
c
You are welcome