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?

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?

Thank you, I had the same problem and for me removing the configuration fixed the error.

Before trying to fix the problem, I asked myself a question, why this custom configuration was in the project in the first place, and is it needed?

The preference I had under both targets can and should be removed. Since the preference was the only entry on the plist file. I could delete the entire file. Supported Intents sections are empty in every target. In conclusion, I have one less Info.plist file in the project and fewer configurations associated with the project.

I would provide a link to my blog but the forum doesn't like my domain.

One of GPTs suggested me to make App Intent declaration public. This actually worked.

WidgetKit with Intent on iOS 17
 
 
Q