Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.

Post

Replies

Boosts

Views

Activity

WatchOS 9 complications with WidgetKit - daily limit.
I am working on an indipendant WatchOS application which received messages from APNS push notifications. There are three kind of messages and each one has it's own widget which represent the current state of the message category. With WatchOS 9, my ClockKit complications are deprecated and I have to migrate to WidgetKit. I did that, but I am having problems with updating the widgets on time. It seems like I am exceeding the widget's daily limit or somehow the OS throttle the updates (they are not instant after the third update in 2 minutes). The main app and the widget extension targets share the data using CoreData. I need to update the widgets every time the database changes. I am currently using WidgetCenter.shared.reloadTimelines(ofKind: ***). I am calling this function when the app is in foreground and thought that the limit should not be a problem, but it looks like it does. Did someone manage to achieve this kind of widgets update?
2
2
1.2k
Sep ’22
iOS16 autofill causes crash while click "key button"(over keyboard)
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally a view controller <_SFAppAutoFillPasswordViewController: 0x106e22ee0> that is already being presented by <UIKeyboardHiddenViewController_Autofill: 0x106e25a10>.' IOS16(not sure other OS version could reproduce this or not) click on textfield, then keyboard shows(with a key button above), click key button, it crashes randomly.
29
18
14k
Sep ’22
The Watch App and iPhone App health care permissions are not synchronized.
I developed an iPhone/Watch app with the single target setting (new method) for Watch app projects, which will be available from Xcode14. This app uses HealthKit to retrieve information such as step count and heart rate from healthcare. The watch app is not independent and requires the iPhone app (companion app). Regarding the permission to access health care, i found some differences from the Old WatchApp Project (application project structure using WatchExtension when Xcode 13.4 or lower is used). This does not occur in the iPhone simulator or watch simulator, but only on the actual device. Both the iPhone app and watch app now display a dialog to allow access to health care In the Old WatchApp Project, if access was granted in either app, the granted access is synchronized. When checking the Health Care access status in the iPhone Settings App, permission settings for both the iPhone app and watch app are displayed independently. Because each permission setting is independent, you can choose to allow access to the iPhone app but not to allow it to the watch app. the Old WatchApp Project, permission settings for the iPhone app and watch app were synchronized, so it was not possible to have different settings for each. These behaviors are not described in the documentation. It would be understandable if the transition from watch "extension" to watch "app" is to split the app into two separate units. However, since there is no official documentation explaining this, i cannot determine whether this is the correct specification or not. Furthermore, since the companion app is required rather than a separate Watch app, having the Health Care permission settings out of sync with the companion app could cause unexpected problems and worsen the user experience. (It would be difficult and cumbersome for the user to know what settings they have made). Is there a solution to synchronize this behavior with the companion app like as the Old WatchApp Project? Do i have to go back to the project configuration (use of watchExtension) before Xcode13? I have prepared a sample project below that can test the above. https://github.com/HayakawaAKIRA/SingleTargetWatchOSApp-HealthKit reference: https://developer.apple.com/videos/play/wwdc2022/10133/ https://developer.apple.com/documentation/watchkit/wkapplication https://developer.apple.com/documentation/healthkit/setting_up_healthkit
6
0
2.0k
Sep ’22
Migrating ClockKit complications to WidgetKit not working
I've implemented delegate method suggested in the article https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app and double (even triple) checked kind and extensionBundleIdentifier of my StaticConfiguration But when I install the app version containing WidgetKit complications they don't replace old ones from ClockKit on the watch face. In the same time old complications are not displayed - I see empty slots. When I check setup in Watch app on the phone I see that old complications remain assigned. If I switch manually to WatchKit based they work fine. It would be helpful if Coffee Tracker code example (referenced in WWDC video and documentation) become updated with migration code.
3
4
2.6k
Sep ’22
Airplane mode with shortcuts not mirroring
Hello I have a shortcut that, among other things, triggers airplane mode on. This however only works on the device i activate the shortcut on. So if i activate it from my watch, my watch goes into airplane mode, but not my phone. Same the other way around. If i turn on airplane mode manually (control center) it does mirror my other devices. I would like the shortcut to work the same way as manual activation. Can anyone help me with that?
3
0
700
Sep ’22
Append Note in Shortcuts
Hi I am trying to create an Apple shortcut in notes where it creates a note with the current date and then appends text to the note below the date. There is already a shortcut on the Gallery “New Note with Date” which is supposed to do this. However, when running the shortcut, it creates the note with date in the background, then asks for what the note needs to say, then a sheet with all recent notes created pops up and you have to select which note the appended text has to be saved to. My question is, is there a way to create the note with the date and append the text to that note automatically? thanks
1
0
1.1k
Sep ’22
Sign in with Apple Js api 403 Forbidden
When I clicked the continue button in the page "https://appleid.apple.com/auth/authorize?client_id=XXXXXXX&amp;redirect_uri=XXXXXX&amp;response_type=code%20id_token&amp;state=asdjhkjhhhs&amp;scope=email&amp;response_mode=web_message&amp;frame_id=XXXXX&amp;m=12&amp;v=1.5.4", I got the error " Your request could not be completed because of an error. Please try again later." the page send a post request Request URL: https://appleid.apple.com/appleauth/auth/oauth/authorize Request Method: POST. Status Code: **403 ** what should I do with that?
6
1
2.7k
Sep ’22
Screen Time API features iOS 15 / iOS 16
Hi folks! Please help me to clarify some things related to Screen Time API. What the keys differences between individual and child authorization? With individual type of auth user can do sign-out from iCloud and delete the app. What else differentiate this type of users? Can we use DeviceActivityEvent for remote control with individual auth? Can the parental or guardian see/get the statistic of apps usage? Is the individual auth available to all users or just those who are in the Apple's family? I'll really appreciate any help and answer! Thank you in advance!
4
0
2.8k
Sep ’22
"Doesn't support the Family Controls capability." Even after getting accepted for family control
I've requested for family control via: https://developer.apple.com/contact/request/family-controls-distribution &amp; got approved. I've now created new provision files with family control being checked in the identifiers &amp; uploaded manually. Yet, still get: Provisioning profile "redoAppStore" doesn't support the Family Controls capability. Provisioning profile "redoAppStore" doesn't include the com.apple.developer.family-controls entitlement. The family control capability is added to my main target (IOS app) as well. What should I do to get it uploaded?
4
0
2.6k
Oct ’22
macOS Mail app crashes on startup, after playing around with Mailkit
I was playing around with Mailkit. I wanted to extract some info, and show a notification when an email arrives. I copied some code that looked alright for notifications and added it to the defailt MailKit template. I ran it, enabled the extension, sent myself an email and.... Mail app crashes I restart the Mail app, and it instantly crashes on launch. I try to comment out the notification code that i added, compile it and restart the Mail app, and it still crashes. Any help for getting my Mail app back to work would be appreciated! Here is the exact code that made this happen. Don't run it locally unless you want your Mail app to no longer work. import MailKit import UserNotifications class MessageActionHandler: NSObject, MEMessageActionHandler {   static let shared = MessageActionHandler()       func decideAction(for message: MEMessage, completionHandler: @escaping (MEMessageActionDecision?) -> Void) {     // The action to take on the message, if any.     var action: MEMessageActionDecision? = nil           // Check if the subject of the message contains the word Mars.     // If it does, specify an action to set the background color to red.     if message.subject.contains("Mars") {       action = MEMessageActionDecision.action(.setBackgroundColor(.red))     }           let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)     var content = UNMutableNotificationContent()      content.title = "Message1"          content.subtitle = "subtitle"          content.body = "body"          content.sound = UNNotificationSound.default          var request = UNNotificationRequest(identifier: UUID().uuidString , content: content, trigger: trigger)          UNUserNotificationCenter.current().add(request)           // Always call the completion handler, passing the action     // to take, or nil if there's no action.     completionHandler(action)   } }
3
1
1.9k
Oct ’22
App Transfer and Sign in With Apple with Firebase
Hi everyone! I am in the process of transferring an app from account (A) to account (B), and I am wondering how the various steps in the documentation link to the transfer process. In particular: https://developer.apple.com/documentation/sign_in_with_apple/transferring_your_apps_and_users_to_another_team -> I understood that this process can be done BEFORE the migration to create all the transfer_sub beforehand. https://developer.apple.com/documentation/sign_in_with_apple/bringing_new_apps_and_users_into_your_team -> when can this be done? After initiating the transfer or only after the transfer is completed? Moreover, what about the private key used for Sign in With Apple from the old team? Will it still work before/after the transfer, or in which step it will stop work? For example, in Firebase we set-up the Apple Sign in using the (A) team_id and private_key. When should we change this in Firebase? After initiating the transfer, after the transfer is completed? Will the old key stop working after the transfer is completed? Thank you!
1
3
1.4k
Oct ’22
ShieldConfiguration not updating when app is open prior to the shield activating
Hello! I believe there is a bug: ShieldConfigurationDataSource extension does not update when the app to be blocked is already open and the ManagedSettingsStore.shield.applications is set to the app that is already open. The shield comes up but has a stale ShieldConfiguration not reflecting the current state of the app is used. I've been able to replicate the issue in an independent app "OffScreen". If you start a blocking time range from 10:00-10:15, it will say "No Twitter until 10:15" and then open Twitter at 10:15. If there is another blocking time range from 10:16-10:31, the app will be open until 10:16 when the shield will reactivate and it will still say "No Twitter until 10:15" when is should say "No Twitter until 10:31". thanks!
3
0
1.3k
Oct ’22
How to connect OpenThread Border Router to Matter Home?
Does anyone know if this is even supported at the moment? I've tried pairing a sample light application based on Silicon Lab's EFR32 but it's unable to find the OTBR on the network. [module](GitHub - SiliconLabs/matter: Matter is creating more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.) I'm also using the RaspberryPi 4/RCP combination as directed by Silicon Lab's documentation. I have no problems pairing the devices to the OTBR directly through its chiptool interface but Home isn't discovering the Thread network or showing me options to add the OTBR devices. I'm currently running iOS 16.1 beta on my iPhone and I'm using a HomePod Mini which is on version 16.0 and has the HomeKit Matter Support profile installed.
2
3
1.8k
Oct ’22
Live Activity color issue in sleep mode
I have created a live activity that supports both light and dark mode, and are using the isLuminanceReduced environment variable to display the dark mode version on the always on display for the iPhone 14 Pro. However it seems that this variable is not true when I switch to the Sleep Mode focus state. Even though the Lock Screen gets just as dark, it still shows the light mode version of the activity, which results text being very hard to read. Any idea on what to do to display the dark mode version here? Or a way to have text that looks good in both light and dark screens?
5
3
1.8k
Oct ’22
CLKComplicationWidgetMigrator not working
I'm trying to migrate from Complication with CLKComplication to WidgetKit. I have implemented the required methods in https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app, but the migration is not working. There is no evidence that the method for migration is also called. It was the same with Xcode 14.0.1 and Xcode 14.1RC. class ComplicationController: NSObject, CLKComplicationDataSource, CLKComplicationWidgetMigrator { ...     @available(watchOS 9.0, *)     var widgetMigrator: CLKComplicationWidgetMigrator {         return self     }     @available(watchOS 9.0, *)     func widgetConfiguration(from complicationDescriptor: CLKComplicationDescriptor) async -> CLKComplicationWidgetMigrationConfiguration? {         return CLKComplicationStaticWidgetMigrationConfiguration(kind: "MyWidget", extensionBundleIdentifier: "com.example.myapp.mywatchkitapp.mywidget")     } } What's wrong? Has anyone been able to migrate?
6
1
1.7k
Oct ’22
Sign In REST API redirect URL to GET instead of POST
Hello, I have implemented a while ago Sign IN with REST API in PHP code. It worked. Now it doesn't. When I redirect to apple with a request: https://appleid.apple.com/auth/authorize?scope=name%20email&state=fffffffstateherefffffff&response_type=code&approval_prompt=auto&redirect_uri=https%3A%2F%2Fmydomain.pl%2Fconnect%2Fapple%2Fcheck&client_id=pl.myclientid&response_mode=form_post I can login via Apple ID and then I am redirected to my webpage. But instead of POST redirect with a code param, I am redirected with GET wihtout the code. The docs says that if I use response_mode=form_post Apple should redirect to me with POST method. But it doesn't. I cannot figure out why. Is this a bug?
1
2
3.2k
Nov ’22