<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WidgetKit",
  "identifier" : "/documentation/WidgetKit/IntentTimelineProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "WidgetKit"
    ],
    "preciseIdentifier" : "s:9WidgetKit22IntentTimelineProviderP"
  },
  "title" : "IntentTimelineProvider"
}
-->

# IntentTimelineProvider

A type that advises WidgetKit when to update a user-configurable
widget’s display.

```
protocol IntentTimelineProvider
```

## Overview

An Intent timeline provider performs the same function as
[`TimelineProvider`](/documentation/WidgetKit/TimelineProvider), but it also incorporates user-configured details
into timeline entries.

For example, in a widget that displays the health status of a game
character the user has chosen, the provider receives a custom
intent specifying the character to display. In your Xcode project,
you then define a custom SiriKit Intent Definition file. The intent
definition can include the character’s details such as its name,
avatar, strategic alliances, and so on.

![A screenshot showing a custom intent definition file configured with an](images/com.apple.WidgetKit/IntentTimelineProvider-IntentDefinition@2x.png)

Xcode generates the following
<doc://com.apple.documentation/documentation/Intents/INIntent> custom
intent:

```
public class SelectCharacterIntent: INIntent {
    @NSManaged public var characterName: String?
    @NSManaged public var avatar: String?
    @NSManaged public var alliances: [String]?
    @NSManaged public var healthLevel: NSNumber?
}
```

Because users can add multiple instances of a particular widget, your
provider needs a way to differentiate which instance WidgetKit is asking
about. When WidgetKit calls
[`getSnapshot(for:in:completion:)`](/documentation/WidgetKit/IntentTimelineProvider/getSnapshot(for:in:completion:)) or
[`getTimeline(for:in:completion:)`](/documentation/WidgetKit/IntentTimelineProvider/getTimeline(for:in:completion:)), it passes an
instance of your custom `INIntent`, configured with the user-selected
details. The game widget provider accesses the properties of the intent and
includes them in the [`TimelineEntry`](/documentation/WidgetKit/TimelineEntry). WidgetKit then invokes the widget
configuration’s content closure, passing the timeline entry to allow the
views to access the user-configured properties. For example, the provider
might implement a `TimelineEntry` with properties corresponding to those in
the custom intent:

```
struct CharacterDetailEntry: TimelineEntry {
    var date: Date
    var name: String?
    var avatar: String?
    var alliances: [String]?
    var healthLevel: Double?
}
```

To generate a snapshot, the game widget provider initializes the character
detail entry using the properties from the intent.

```
struct CharacterDetailProvider: IntentTimelineProvider {
    func getSnapshot(for configuration: SelectCharacterIntent, in context: Context, completion: @escaping (CharacterDetailEntry) -> Void) {
        let entry = CharacterDetailEntry(
            date: Date(),
            name: configuration.characterName,
            avatar: configuration.avatar,
            alliances: configuration.alliances,
            healthLevel: configuration.healthLevel?.doubleValue
        )
        completion(entry)
    }
}
```

## Topics

### Generating Timelines

[`getSnapshot(for:in:completion:)`](/documentation/WidgetKit/IntentTimelineProvider/getSnapshot(for:in:completion:))

Provides a timeline entry representing the current time and state of a
widget.

[`getTimeline(for:in:completion:)`](/documentation/WidgetKit/IntentTimelineProvider/getTimeline(for:in:completion:))

Provides an array of timeline entries for the current time and,
optionally, any future times to update a widget.

[`placeholder(in:)`](/documentation/WidgetKit/IntentTimelineProvider/placeholder(in:))

Provides a timeline entry representing a placeholder version of the
widget.

[`Entry`](/documentation/WidgetKit/IntentTimelineProvider/Entry)

A type that specifies the date to display a widget, and, optionally,
indicates the current relevance of the widget’s content.

[`Intent`](/documentation/WidgetKit/IntentTimelineProvider/Intent)

The intent that contains user-customized values.

[`recommendations()`](/documentation/WidgetKit/IntentTimelineProvider/recommendations())

Returns a set of intent recommendations you use to offer pre-configured
widgets on platforms that don’t offer a dedicated user interface for
customizing widget intents.

[`IntentTimelineProvider.Context`](/documentation/WidgetKit/IntentTimelineProvider/Context)

An object that contains details about how a widget is rendered, including its size and whether it
appears in the widget gallery.

## See Also

  <doc://com.apple.documentation/documentation/Intents/INIntent>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)