Background
I'm developing an iOS app with Live Activities that allows users to select custom background images. While these custom images display correctly in widgets, they fail to appear in Live Activities on both Lock Screen and Dynamic Island, despite successful image loading and data transfer.
Technical Details
- iOS Version: Testing on iOS 17.2+
- Image Storage: Using App Group shared container for image sharing between main app and widget extension
- Image Loading: Successfully confirmed via logs - images load correctly with proper dimensions
- UI Framework: SwiftUI with ActivityKit
What Works
✅ Custom images display correctly in Home Screen widgets
✅ Built-in bundled images work in Live Activities
✅ Image data successfully transfers via App Group shared container
✅ Image loading logs show successful UIImage creation with correct dimensions
What Doesn't Work
❌ Custom user images don't display in Live Activities (Lock Screen) ❌ Custom user images don't display in Dynamic Island ❌ Images appear as black/gray background despite successful loading
Code Implementation
I've tried multiple approaches:
1. SwiftUI Image approach:
Image(uiImage: customImage)
.resizable()
.aspectRatio(contentMode: .fill)
2. containerBackground API approach:
.containerBackground(for: .widget) {
Image(uiImage: customImage)
.resizable()
.aspectRatio(contentMode: .fill)
}
3. UIKit wrapper approach:
struct UIImageViewWrapper: UIViewRepresentable {
let image: UIImage
func makeUIView(context: Context) -> UIImageView {
let imageView = UIImageView(image: image)
imageView.contentMode = .scaleAspectFill
return imageView
}
func updateUIView(_ uiView: UIImageView, context: Context) {
uiView.image = image
}
}
Observations
- Images load successfully (confirmed via console logs)
- File paths are correct and accessible
- Same image loading code works perfectly in widgets
- When testing with UIKit approach, a red prohibition icon appears, suggesting system restrictions
Questions
- Is there a technical limitation preventing user-provided images from displaying in Live Activities?
- Are there specific security restrictions for Live Activity backgrounds that don't apply to widgets?
- Is this behavior intentional based on Apple's design guidelines for Live Activities?
- What's the recommended approach for custom backgrounds in Live Activities?
Apple Documentation Reference
I found this guidance in "10 questions with the Live Activities team":
"The Dynamic Island is most immersive when you don't provide background color or imagery — think of it purely as a canvas of foreground view elements."
However, this seems to be design guidance rather than a technical restriction, and it doesn't specifically address Lock Screen Live Activities.
Expected Behavior
Custom user images should display as backgrounds in Live Activities, similar to how they work in widgets.
Current Workaround
I've implemented a color extraction system that generates gradients based on the dominant colors of user images, but users specifically want to see their actual images.
Has anyone successfully implemented custom user images as Live Activity backgrounds, or can Apple clarify the intended behavior and limitations?
Thank you for any insights!