I'm developing a CarPlay Fueling app with CarPlay entitlement properly configured. While testing, I ran into two issues and would appreciate any guidance:
- UserDefaults access while iPhone is locked:
In my CarPlay implementation, I read values from UserDefaults that were previously saved in the iOS app. However, when the iPhone is locked and the CarPlay session is active, it seems that the CarPlay extension cannot read the stored values. Is this the expected behavior? If so, how can I persist and access data across the app and CarPlay reliably?
- API calls while iPhone is locked:
The CarPlay interface in my app communicates with a server to display lists and detail views. When the iPhone is locked, are network calls still allowed from the CarPlay extension? Currently, I do not have any background modes enabled in the app capabilities. If I enable background modes and implement background network logic to ensure API calls complete properly, would this be considered acceptable usage for CarPlay in App Store review? Or could it raise any rejection concerns during the approval process?
Thanks in advance for your help.
Hi,
CarPlay is part of your app, not an extension in your app. When your app is on the CarPlay screen, your app is considered foregrounded, as it has a scene that is in the foreground. You should be able to perform network calls and user defaults lookups as normal. If you're not seeing that behavior as expected, please file a feedback report. Thanks!