Found the solution by digging through this sample project https://developer.apple.com/documentation/RealityKit/composing-interactive-3d-content-with-realitykit-and-reality-composer-pro
Note that the accompanying WWDC video presents a different method, which throws compiler errors, so ignore that. Thanks Apple!
struct MyAugmentedView : View {
private let notificationTrigger = NotificationCenter.default.publisher(for: Notification.Name("RealityKit.NotificationTrigger"))
var body: some View {
// Add the following modifier to your RealityView or ARView:
.onReceive(notificationTrigger) { output in
guard
let notificationName = output.userInfo?["RealityKit.NotificationTrigger.Identifier"] as? String
else { return }
switch notificationName {
case "MyFirstNotificationIdentifier" :
// code to run when this notification received here
case "MySecondNotificationIdentifier"
// etc
default:
return
}
}
}
}