I integrated new ios 14 widgets in my app, and i am seeing a spike of apis when widget are being reloaded.
So to give perspective what i have done is that i make 2-3 api calls to get data in order to show in widget and after every 30 mins they are reloaded as shown below.
But the issue i am facing is that in analytic chart i am seeing api spike every 30 mins and not in between(or scattered) for collective users.
In my understanding if a user A adds widget at 1:00 so widget should be reloaded at approx 1:30 and if user B adds widget at 1:10 it should be reloaded at 1:40, but instead i see that a triangle spike at 1:30, 2:00, 2:30 etc.
Is someone else facing the same issue or I am missing something?
Asked apple about it, it gave me links on how to reload using widgetcenter or their guide from which i made my widgets.
So to give perspective what i have done is that i make 2-3 api calls to get data in order to show in widget and after every 30 mins they are reloaded as shown below.
But the issue i am facing is that in analytic chart i am seeing api spike every 30 mins and not in between(or scattered) for collective users.
In my understanding if a user A adds widget at 1:00 so widget should be reloaded at approx 1:30 and if user B adds widget at 1:10 it should be reloaded at 1:40, but instead i see that a triangle spike at 1:30, 2:00, 2:30 etc.
Is someone else facing the same issue or I am missing something?
Asked apple about it, it gave me links on how to reload using widgetcenter or their guide from which i made my widgets.
Code Block func getTimeline(in context: Context, completion: @escaping (Timeline<WidgetEntry>) -> Void) { WidgetManager.shared.fetchData(widgetFamily: context.family, completion: { widgetData in let date = Date() let relevance = TimelineEntryRelevance(score: 70) let entry = WidgetEntry(date: date, relevance: relevance, widgetData: widgetData) let nextUpdateDate = Calendar.current.date(byAdding: .minute, value: 30, to: date)! let timeline = Timeline(entries:[entry], policy: .after(nextUpdateDate)) completion(timeline) }) }