WidgetKit with Intent on iOS 17

I have edited the default widget with Intent, but am being hit with the following errors… it runs perfectly fine if I don’t use an Intent in a static widget

  1. Could not find an intent with identifier ConfigurationAppIntent, mangledTypeName: Optional("27trainWidgetsConfigExtension22ConfigurationAppIntentV")
  2. associateAppIntent(forUserActivity:) Error converting INIntent to App Intent: AppIntents.PerformIntentError.intentNotFound

I think it may be something to do with Info.plist?

Replies

Update: I worked it out, I needed to add my intent to 'Supported Intents' in my app target config.

I am now facing the following problem: The widget is showing placeholder coloured boxes when placed on the home screen. It shows fine in the preview before adding to Home Screen.

I think this is because the AppIntentTimelineProvider is looking for timeline(), whereas a static widget (TimelineProvider) and iOS are looking for getTimeline(). If I change timeline() to getTimeline(), it says it doesn’t conform. placeholder() is the same in both providers, which is why it shows fine before adding to home screen

I can provide screenshots, but it doesn't let me upload them

What did you add under Supported Intent to get rid of the warning?

  • To resolve this issue the AppIntent needs to be added to the main app target. Go to YourAppTarget -> General -> Supported Intents, and add your AppIntent by copying and pasting the name into Class Name. You can then choose whether the user needs to authenticate to use it.

  • I tried it this way but it didn't work, is there another solution?

Add a Comment