WidgetKit

RSS for tag

Show relevant, glanceable content from your app on the iOS Home screen, iOS Lock screen, in macOS Notification Center, and as complications on Apple Watch.

WidgetKit Documentation

Posts under WidgetKit tag

136 Posts
Sort by:
Post not yet marked as solved
0 Replies
100 Views
We are running into a major issue with building an iOS Widget. iOS Widgets are basically large informational app icons you can pin to your iPhone home screen (What is a widget?). iOS widgets were introduced in iOS 14. We’ve finished building our iOS widget. However, when half of our users attempt to search for our widget after downloading our app, our widget is not showing up in the widget search results. For the other half, it works fine. This seems to be somewhat of a bug from Apple, as it is affects other widget apps (Apple Thread, the problem exists for large widget apps also). It seems like we are having this issue far more, percentage-wise, than other widget apps. I’ve searched through nearly every resource online (StackOverflow, etc.), which is why I’m posting a question now. Things like deleting the app and reinstalling, restarting the phone, etc. have not been a fix either for these problematic users. It doesn't seem to be tied to any iOS version (14, 15, etc.). As I have iOS 15, and it works fine. But, some users with iOS 15 are getting the bug. Has anyone ran into this issue where a widget is not searchable? How did you fix it? Any resources are appreciated as I am at a major blocker right now. Since my app is primarily based on iOS widgets, this makes it basically unusable for certain users.
Posted Last updated
.
Post not yet marked as solved
2 Replies
223 Views
Hello, I am trying out the new Watch Complications in WidgetKit and I am stuck on the widget '.accessoryCorner'. Unfortunately, I can't find a way to create a curved text as shown in the image in the upper left corner ('HON'). Using the '.widgetLabel' does insert a curved label in the second line, but the text above it in the first line remains horizontally arranged. Has anyone found a solution for this yet? Thanks for the help Thomas
Posted
by Thomas.
Last updated
.
Post not yet marked as solved
2 Replies
1.6k Views
Good morning, if I understood correctly, Live Activities will come on a later iOS 16 update and are not present on the current iOS 16 beta. I think that might explain the lack of documentation on the subject. What I'd like to understand is what could be the best path to take to make sure we're prepared to build a Lock Screen widget with Live Activities. Is a Home Screen widget a good starting point? Does anyone know? Can an Apple engineer shine some light into the topic? Thank you
Posted Last updated
.
Post not yet marked as solved
0 Replies
93 Views
I could make countdown on watch complication by using [.timer]. However its showing [Hour], [Minute] and [Second], and I just want to show [Second] instead of [Hour] and [Minute]. Lets say if I set the time with [5 minutes] then I would like to make it showing [300] instead of [5:00]. So what will be the best code I should write? Please kindly advise.
Posted
by JJMARSLiN.
Last updated
.
Post not yet marked as solved
0 Replies
96 Views
How to establish communication with multiple parameters in single intent with a parent-child relationship? Where the output of the parent parameter will be input for the child parameter.
Posted Last updated
.
Post not yet marked as solved
0 Replies
161 Views
Will there be a user interface to configure lock screen widgets like home screen widgets? This seems to be implied as possible based on the stock apps, such as the Clock app lock screen widget saying "Add a clock for a city to check the time at that location." I could not figure out how to bring up the configuration GUI: long press various places has no effect.
Posted
by t9mike.
Last updated
.
Post marked as Apple Recommended
3.4k Views
My app, Class Clock, currently offers a Today Widget that displays a circular timer similar to the timer in iOS 13 and a few labels to show the user how much time is left in class. With the new WidgetKit, I understand the widget's timeline is only updated every so often. However, if the circular timer needs to load every minute, how can this be achieved? Could I perhaps tell the timeline that Class A is from 10 - 11 and the widget then animates between 10 and 11 on its own without calling a new timeline every minute? Ideally, the circular progress indicator would continue to animate its SwiftUI Circle trim percentage every second or minute.
Posted
by levikline.
Last updated
.
Post not yet marked as solved
0 Replies
131 Views
I'm trying to add a watchOS app and watch widgets to an existing iOS project, similar to what's shown in wwdc2022-10050. The widget works fine when I select the iOS scheme, but when I switch over to the watchOS widget scheme, Xcode fails to generate a preview and gives this error. I'm not sure how to enable support for previews properly. UnsupportedProductTypeError: Previews not supported for WeatherNewWidget Watch Previews can be defined in applications, frameworks, Swift packages, or dynamic libraries productType = com.apple.product-type.extensionkit-extension buildable = WeatherNewWidget Watch.appex
Posted
by Jevon_Mao.
Last updated
.
Post not yet marked as solved
7 Replies
2.0k Views
I had to create a separate thread for the problem I'm facing with WidgetKit. Environment: Xcode 12.0.1 iOS 14.0 App targeting iOS 10 Widget targeting iOS 14 Intents Extension targeting iOS 10 • I have created Intents Extension. • Created Intents Definition file in Widget target, added it to all the three targets (app, widget, intents extension).  • Declared conformance to the intent handling protocol in IntentHandler (Intents Extension). • Set up Intent Timeline Provider in Widget target.  • Added Siri to the app capabilities. If I go to Edit widget -> tap on a dynamic option it says: No options were provided for this parameter. Intents Extension provides data, but I'm not sure how iOS wires the Intents Extension and widget. From what I see I'm sure that my code inside IntentsHandler.swift is never called.
Posted
by Jauzee.
Last updated
.
Post not yet marked as solved
6 Replies
968 Views
My widget updates fine at iOS 14.x but it is not updating on iOS 15. If I install my app on a iOS15 device, the widget updates once directly after installation, but than the timeline is not executed anymore. The same widget works perfectly at iOS 14.x and updates every 15 minutes as designed. Even WidgetCenter.shared.reloadAllTimelines() is not working from the main app. Can someone help? Is there any necessary change for iOS 15 that I have missed? here is the code:     func getTimeline(in context: Context, completion: @escaping (Timeline<SolarEntry>) -> ()) {         var entries: [SolarEntry] = []         Loadinggroup.enter()         InitLoadData()         Loadinggroup.notify(queue: .main) {         // Generate a timeline updating every 15 min, starting from the current date.         let currentDate = Date() //        refresh every 15 min:             let entryDate = Calendar.current.date(byAdding: .minute, value: 15, to: currentDate)!             let entry = SolarEntry(date: entryDate, solarout:solaroutString, gridout:gridoutString, acpower: acpowerString, batpower: batpowerString, batstate: batstateString, lastupdate:  lastupdateString)                          entries.append(entry) //        }         let timeline = Timeline(entries: entries, policy: .atEnd)         completion(timeline)     }     }
Posted
by JHe.
Last updated
.
Post not yet marked as solved
0 Replies
115 Views
I'm excited to already have a widget/complication running on watchOS using WidgetKit. It's a great framework! Next, I need to get some settings from my iOS app over to the watch to help configure the widget. Ideally, I'd like the user to be able to change settings on the iOS app, and have them reflected in the watch widget pretty soon after without having to do anything on the watch. (From early testing, updateApplicationContext is decent because it can still be sent even when the watch app isn't active, but unfortunately it doesn't seem to wake up to process this incoming data until the user manually opens the app on the watch again. But maybe I've missed something.) Anyway, what's the best way to do this configuration between phone and watch?
Posted
by breville.
Last updated
.
Post not yet marked as solved
1 Replies
347 Views
We had "Today widgets" that worked perfect for a long time. After introducing the new Widgets Extension we added a Widgets Bundle to our app. Now after every app update the old widgets disappear from "Today view" and can be bring back ONLY by rebooting the iPhone. Sometime when they disappear, in today view appears the first widget from the Widgets Bundle. I've tested other apps too and it happens every time to apps that support old and new widgets (Xiaomi Home app for example). Does anyone have a clue how to fix that?
Posted
by Tabakov.
Last updated
.
Post not yet marked as solved
9 Replies
3.1k Views
Any insights on how to incorporate CloudKit (or CoreData) in the WidgetKit extension? Where in the WidgetKit api do I make the asynchronous call to load the data to be available for the TimelineProvider?
Posted
by cristosv.
Last updated
.
Post marked as solved
2 Replies
241 Views
Hi, I created a widget for our application. The application is manually signed for distribution. I created a new identifier and provisioning profile for distribution for the widget. The new identifier is our app identifier with ".widget" appended. After I added both the app and widget provisioning profiles to my export.plist for the xcodebuild step, the app builds without error. When I try to validate the app before upload, I get this error: Error: Invalid Signature. Code object is not signed at all. The file at path [MyApp.app/PlugIns/MyAppWidget.appex/fix_imports.sh] is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. The provisioning profiles in the export.plist are for distribution. Has anyone else encountered and fixed error? I'm stumped! Claire
Posted
by claires.
Last updated
.
Post marked as solved
2 Replies
226 Views
I have a simple complication-only app called Roughly, which shows the approximate time in words, to the nearest five minutes, in a choice of languages. It's been on the store for several years, and it's getting creaky. This new guide to WidgetKit is making me nervous: https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app There's a line buried in there: watchOS 9 and later no longer shows families like CLKComplicationFamily.circularSmall, CLKComplicationFamily.modularSmall, or CLKComplicationFamily.modularLarge on watch faces. So... is that the end of all basic complications that haven't been made into Widgets? If so, it would be good to have more clarity on this — I do feel it's easy to miss when things are deprecated. Thanks for any info!
Posted Last updated
.
Post not yet marked as solved
2 Replies
821 Views
Have been days I am stuck on this, really hoping someone can help. I have added Widget to my existing AppKit project (macOS), and all works fine. However when I try to archive, it keeps failing at this error: 2020-11-14 23:58:29 +0000&#9;/var/folders/gv/cqghcvl50690hwhk3bbpf7pr0000gn/T/XcodeDistPipeline.~~~HAVL4T/Root/Applications/XXXX.app/Contents/PlugIns/Mac WidgetExtension.appex: replacing existing signature 2020-11-14 23:58:29 +0000&#9;/var/folders/gv/cqghcvl50690hwhk3bbpf7pr0000gn/T/XcodeDistPipeline.~~~HAVL4T/Root/Applications/XXXX.app/Contents/PlugIns/Mac WidgetExtension.appex: code object is not signed at all 2020-11-14 23:58:29 +0000&#9;/usr/bin/codesign exited with 1 Have tried: Clearing and removing all certificates Upgrading to Big Sur Removed and recreate Widget Target Manually creating provisioning profiles
Posted
by terenze.
Last updated
.
Post not yet marked as solved
0 Replies
132 Views
I bought new iphone 11 and when i made the photo widget it says no contant available, i did leave it all night with the charger on but nothing changed, i sign out and re-log into apple id and removed the widget , restarted the phone but the situation is the same, what should i do??
Posted Last updated
.
Post not yet marked as solved
0 Replies
174 Views
Incompatible widget content The body of the widget entry's view contains the following unsupported types: PlatformViewRepresentableAdaptor. All I have in the body of my accessoryCircular widget is: ProgressView(value: 0.3, total: 1.0) Any way to fix this?
Posted
by mqazwini.
Last updated
.
Post not yet marked as solved
1 Replies
435 Views
My main project is developed using Object-c. When I choose to use Intents, when I transfer data from the main project to the IntentHandler, the following errors occur 1. Cannot find type'ConfigurationIntent' in scope 2. Cannot find type'Members 'in scope
Posted Last updated
.
Post marked as solved
19 Replies
14k Views
In the OC project, iOS14 WidgetKit target was added, but consistent error Cannot find type "ConfigurationIntent" in scope, type 'Provider' does not conform to protocol 'IntentTimelineProvider' What is strange is that after adding a new OC project, the compilation is successful, Tool: Xcode12-beta &amp; Simulator How to get access to old projects?
Posted
by zhangkk.
Last updated
.