What is ChronoKit.InteractiveWidgetActionRunner.Errors Code 1?

This is a follow up to this post about building a Control Center widget to open the app directly to a particular feature. I have it working in a sample app, but when I do the same thing in my full app I get this error:

[[com.olivetree.BR-Free::com.olivetree.BR-Free.VerseWidget:com.olivetree.BR-Free.ContinueReadingPlanControl:-]] Control action: failed with error: Error Domain=ChronoKit.InteractiveWidgetActionRunner.Errors Code=1 "(null)"

Google has nothing for any of that. Can anyone shed light on what it means?

This is my control and its action:

@available(iOS 18.0, *)
struct ContinueReadingPlanControl : ControlWidget {
    var body: some ControlWidgetConfiguration {
        StaticControlConfiguration(kind: "com.olivetree.BR-Free.ContinueReadingPlanControl") {
            ControlWidgetButton(action: ContinueReadingPlanIntent()) {
                Image(systemName: "book")
            }
        }
        .displayName("Continue Reading Plan")
    }
}

@available(iOS 18.0, *)
struct ContinueReadingPlanIntent : ControlConfigurationIntent {
    static let title: LocalizedStringResource = "Continue Reading Plan"
    static let description = IntentDescription(stringLiteral: "Continue the last-used reading plan")
    static let isDiscoverable = false
    static let opensAppWhenRun: Bool = true
    
    @MainActor
    func perform() async throws -> some IntentResult & OpensIntent {
        let strUrl = "olivetree://startplanday"
        UserDefaults.standard.setValue(strUrl, forKey: "StartupUrl")
        
        return .result(opensIntent: OpenURLIntent(URL(string: strUrl)!))
    }
}

Note also that I'm pulling this from Console.app, streaming the logs from my device. I don't know of a way to debug a Control Center widget in Xcode, though this thread implies that it's possible.

widgetURL is the API you'd want to use to ensure your app is opened to a certain location. You can use shared defaults as well but this process isn't always immediate as defaults must synchronize.

Lastly, UserDefault.standard won't work across processes in your app as setting it in your Intent code may be from your Widget target, making it unreadable. You should be using an App Group and UserDefaults(suiteName:) with your app group, which would make it available everywhere.

Rico

WWDR - DTS - Software Engineer

[@Mr. Jefferson](https://developer.apple.com/forums/profile/Mr. Jefferson)

I solved the problem. because your Intent openAppWhenRun = true, so the intent must be included in both the main target and the widget target

What is ChronoKit.InteractiveWidgetActionRunner.Errors Code 1?
 
 
Q