DeviceActivityReport fails to display SceneView

I am trying to return a SceneView from a DeviceActivityReport. I have my DeviceActivityReportExtension correctly set up and I am able to display a view with text or other UI elements in it, but attempting to return a SceneView as part of the body just won't display. I have this example. When I display this SceneView in my main app, it displays correctly. When I put the same code inside the DeviceActivityReportExtension, the scene does not show up and an error failed to create a gl context appears repeatedly in the console. I'm pretty stumped and would appreciate any suggestions.

import SwiftUI
import SceneKit

struct TestScene: View {
    var scene: SCNScene? {
        SCNScene(named: "art.scnassets/environment.scn")
    }

    var cameraNode: SCNNode? {
        let cameraNode = SCNNode()
        cameraNode.camera = SCNCamera()
        cameraNode.position = SCNVector3(x: 0, y: 0, z: 2)
        return cameraNode
    }

    var body: some View {
        SceneView(
            scene: scene,
            pointOfView: cameraNode,
            options: [
                .allowsCameraControl,
                .autoenablesDefaultLighting,
                .temporalAntialiasingEnabled
            ]
        )
    }
}

Where is your DeviceActivityReportScene that declares your view as the content?

Such as

// Define the custom configuration and the resulting view for this report.
let content: (String) -> TotalActivityView

Hello, thanks for your response. Since I first posted, I discovered I can get the scene to render within the iPhone simulator on my mac, but not on my physical iPhone. However, the scene renders fine on my phone when it is in the main app and not within the DeviceActivityReportExtension, so I don't think it's a hardware issue with my phone. Here is my DeviceActivityReportExtension containing my DeviceActivityReportScene.

import DeviceActivity
import SwiftUI

@main
struct TestActivityReport: DeviceActivityReportExtension {
    var body: some DeviceActivityReportScene {
        TotalActivityReport { totalActivity in
            TotalActivityView(totalActivity: totalActivity)
        }
    }
}

Here is how I am calling the extension from the main app

struct ContentView: View 
    let context = DeviceActivityReport.Context.totalActivity
    let now = Date()
    let oneWeekAgo = Calendar.current.date(byAdding: .day, value: -7, to: Date())!
    var body: some View {
            DeviceActivityReport(context, filter: DeviceActivityFilter(segment: .daily(during: DateInterval(start: oneWeekAgo, end: now))))
    }
}

The TotalActivityView just renders the TestScene from my initial post.

Thanks!

DeviceActivityReport fails to display SceneView
 
 
Q