Notification.Name( "RealityKit.NotificationTrigger" ) ) for await notification in realityKitNotifications { guard let triggerID = notification.userInfo?[“RealityKit.NotificationTrigger.Identifier"] else { ... } switch triggerID { case "PrintHello": print("Hello") ... } } Code will be shared at the end
scene else { print(“❌ Cannot post notification without a scene") return } NotificationCenter.default.post( name: Notification.Name("RealityKit.NotificationTrigger"), object: nil, userInfo: [ "RealityKit.NotificationTrigger.Scene": scene as Any, "RealityKit.NotificationTrigger.Identifier": "PleaseStopTrain" ] ) Code will be shared at the end