Prioritising your widget for repeat information

It says that the widget priority is base on the value you give for this widget message compared to previous ones you have sent.

So how do you ensure that this works for things like an upcoming flight. If we send the same priority as for the previous upcoming flight does that mean iOS gives it a lesser value this time and we need to keep sending an exponentially increased value?
Answered by Documentation Engineer in 615256022
You are correct in stating that the widget priority is determined by comparing your current relevance score to past and future relevance scores provided in your timeline. To make this system work for the Upcoming Flight scenario, you would not need to set an exponentially increasing score. We recommend that you pick a schema for assigning relevance and keep it consistent across all your updates. 

For instance: Imagine that the user has an upcoming flight at 12 PM on a Friday. In timeline updates before 8 AM on Friday, the timeline updates’ relevance scores can be set to 0. As the flight approaches, the relevance score can be set to 100 (a high value relative to other entries). At 1 PM, when the flight has already departed, the relevance score can be set back to 0. You can also pick a continuous schema such as gradually increasing relevance scores as we get closer to the flight time. The methodology that you have chosen can be used for all future flights. 

The system will prioritize higher relevance scores relative to the other scores you have provided in your timeline (including scores for future timeline entries). In fact, if you can provide future timeline entries in your WidgetKit donations, this can help the system to further optimize when your widget is presented to the user to maximize the value of the Stack Rotation.

Please see this documentation for more information: https://developer.apple.com/documentation/widgetkit/timelineentryrelevance
In situations like this you can provide multiple timeline entries with varying relevance. So, for example, the day before the flight your entry might have a relevance of 5, 6 hours before the flight could value of 10, and 2 hours before could have a relevance score of 20. There is no requirement that the view for each entry has to change, but you can update per entry if you'd like as well.

See Keeping a Widget Up To Date for more details about returning timelines.
Thanks and i understand that.

My question is the scenario where the user has 2 flights. Our widget shows information about their next upcoming flight. So for the first flight for the widget we show a relevance score of 20 for the most critical time period. However, what happens for the second flight? If we use the relevance score of 20 again then will it be marked down by iOS as that's the same score we already used, or as this is a different flight does the iOS view this as a completely different widget from the same app and therefore we can reuse the same relevance scores again?
Accepted Answer
You are correct in stating that the widget priority is determined by comparing your current relevance score to past and future relevance scores provided in your timeline. To make this system work for the Upcoming Flight scenario, you would not need to set an exponentially increasing score. We recommend that you pick a schema for assigning relevance and keep it consistent across all your updates. 

For instance: Imagine that the user has an upcoming flight at 12 PM on a Friday. In timeline updates before 8 AM on Friday, the timeline updates’ relevance scores can be set to 0. As the flight approaches, the relevance score can be set to 100 (a high value relative to other entries). At 1 PM, when the flight has already departed, the relevance score can be set back to 0. You can also pick a continuous schema such as gradually increasing relevance scores as we get closer to the flight time. The methodology that you have chosen can be used for all future flights. 

The system will prioritize higher relevance scores relative to the other scores you have provided in your timeline (including scores for future timeline entries). In fact, if you can provide future timeline entries in your WidgetKit donations, this can help the system to further optimize when your widget is presented to the user to maximize the value of the Stack Rotation.

Please see this documentation for more information: https://developer.apple.com/documentation/widgetkit/timelineentryrelevance
Thanks that makes and i'll read up on TimelineEntryRelevance
No, using the same score will not be marked down as long as you also provide entries with lower scores when there is no flight to emphasize the importance when there is a flight. In the upcoming flight scenario, your widget can reuse the same relevance score of 20 for both the flights. You will not need to create separate widgets or intents for each flight.The system views relevance scores relative to all the other scores from the same widget. As an app developer, you are in the best position to decide which timeline entries deserve a higher score and should be prioritized by the system.

Prioritising your widget for repeat information
 
 
Q