Adjust your app’s behavior and filter incoming notifications based on the user's Focus settings.

Focus Documentation

Posts under Focus tag

17 Posts
Sort by:
Post not yet marked as solved
0 Replies
101 Views
I added a SetFocusFilterIntent to my project, but when I try to add the Focus Filter, the "add" button is disabled. I want to know why I cannot add a Focus Filter. I tried the same implementation of SetFocusFilterIntent in an empty project, and it works as expected.
Posted Last updated
.
Post marked as solved
1 Replies
225 Views
I have had issue with sleep focus on my watch 8 since late in the iOS 16/ WatchOS 9 betas. I opened a feedback in Oct 2023 when 10.1 betas. When sleep focus is on the watch shows it's active and did not alert but it still works like normal. It used to go dark and I could tap the screen to see the time and press the crown to exit from that mode to use it. I wish this would be fixed. I'm tried of having to use theater mode with I go do bed. The light of the watch is
Posted Last updated
.
Post marked as solved
2 Replies
255 Views
I have noticed since later 9.x betas that sleep focus no long switches the watch to just a clock. In the past, when sleep focus is turned on, my screen would go blank and if I tapped the screen the time would appear. if I held the crown in, it would "unlock" from time display only and allow me to use my watch. Since this has started I have posted in the feedback app starting in 10.1. Now I have to set my watch into Theater mode every night so that the screen is off and not lighting up the room. After each new beta release I update my feedback. Any idea if anyone has seen my feedback?
Posted Last updated
.
Post not yet marked as solved
2 Replies
418 Views
We are developing an app which uses AVCaptureSession. Here is a part of my code: if context.config.basic_settings.auto_focus == 1 { // 自動フォーカス device.focusMode = AVCaptureDevice.FocusMode.continuousAutoFocus completion() } else { device.focusMode = AVCaptureDevice.FocusMode.locked var _lenspos = Float(context.config.basic_settings.lens_position) ?? 0.5 if _lenspos > 1.0 { _lenspos = 1.0 } if _lenspos < 0.0 { _lenspos = 0.0 } device.setFocusModeLocked(lensPosition: _lenspos, completionHandler: { (time) in completion() }) } This code can successfully set focus mode to autofoucs or manual focus and also can set lens position perfectly if we use iPhone13 or iPhone14. But If we use iPhone15, this code cannot set the focus mode or lensposition. We also tried with different iPhone15 devices, but the result is always the same(fails to set focus). And also used different iPhone13 and iPhone14 devices. But these iPhones can set the focus correctly everytime. Is it a bug of iPhone15? Or is there anything that I can do about the issue?
Posted
by utshas.
Last updated
.
Post not yet marked as solved
0 Replies
476 Views
Hello Apple Community, I am writing to discuss a limitation I’ve encountered with third-party alarm clock apps on iOS. As it stands, these apps are unable to function like the native Clock app, primarily due to the restrictions imposed by the operating system. Currently, third-party alarm apps rely on standard local notifications, which fire once and then cease. This means that if a user misses the initial notification, there’s no backup mechanism to ensure they are alerted. This is a significant drawback for users who rely on these apps to manage their time effectively. Moreover, some apps have found a workaround by playing a silent sound in the background to keep the app active. However, this method is not only against Apple’s guidelines but also drains the device’s battery life. I propose that Apple consider allowing third-party apps to push notifications from the background in an alarm style, with clear permissions granted by the user. This would enable users to clearly define acceptable notifications and specify an alarm-like display, providing a more personalized and effective alarm experience. By implementing this change, Apple could greatly enhance the functionality and user-friendliness of third-party alarm clock apps, ultimately benefiting the end-users and developers alike. Because this alarm feature is so important for productivity and quick responses to critical events or triggers I'm trying to see how some concepts could be reimagined if we had a little more flexibility. Apple iOS has a feature called StandBy mode that activates when an iPhone is charging and positioned on its side. This feature can be thought of as a kind of smart display for your iPhone that offers fast access to different screens of glanceable information. Always-On Display: StandBy mode can keep the display on even when the phone is locked, which is useful for an alarm app. Users can glance at the time without having to unlock their phone w/ Low-Light Adaptation Customizable Screens: StandBy mode consists of screens that can be accessed by swiping horizontally on your iPhone’s display. This could allow an alarm app to display additional information, such as route, or weather warnings. Interactive Widgets: The widget screen in StandBy mode is interactive and customizable. I look forward to hearing your thoughts on this matter. Best regards, Phil Cutting
Posted Last updated
.
Post not yet marked as solved
0 Replies
306 Views
We are developing a parental control system. The application is written with .NET Xamarin for the framework version 4.8. The Mac version is addressed anything down to Mac OS 10.9, Maverick The application is running in the menu bar only and will fire a dialog, but the application does not have a real main window. We are currently adopting the applications to accessibility and 2 issues : during installation we need to elevate the account, the resulting "enter admin password"-dialog (system dialog) is not gaining focus, and as such is not getting a voice over help. when ever alert is shown, the focus is not pushed to the alert. (basically the same as also not getting voice over help)
Posted
by hcarsten.
Last updated
.
Post not yet marked as solved
1 Replies
462 Views
How to change default white color of tvos swift UIButton focus selection? override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) { if let nextFocusedView = context.nextFocusedView { playAllOutlet.backgroundColor = UIColor.red shuffleBtnOutlet.backgroundColor = UIColor.green } if let previousFocusView = context.previouslyFocusedView { playAllOutlet.backgroundColor = UIColor.red shuffleBtnOutlet.backgroundColor = UIColor.green } } But background when button is focused is still white
Posted Last updated
.
Post marked as solved
1 Replies
449 Views
Hi Is there a way to read the sleep schedule i have set in either the health or clock apps? I found a few posts on here asking the same thing and the responce was always either no or just no responce but they are all from over 2 years ago so im not sure if something has changed since then. Up untill recently i was using a shortcuts automation to get the data but a recent update started excluding the sleep schedule alarm from the list that the shortcuts app can pull from the clock app. I dont want historical data, just when the alarm is set to go off next. I was using it to turn my lights on dim half an hour before the alarm goes off without having to set the schedule in 2 places. I have an annoyingly inconsistent morning schedule. Thanks
Posted
by TomW1605.
Last updated
.
Post not yet marked as solved
0 Replies
337 Views
I’m trying to follow the instructions for creating a new Focus on my iPhone 13 Pro Max (running iOS 17.0 (Developer Beta (21A5326a))). I do not see an Add button (blue +) in the upper right side of the page that lists my current Focus options. I have a total of ten options set up and I want to add another. Here is a screenshot of what I see:
Posted Last updated
.
Post not yet marked as solved
0 Replies
674 Views
In iOS 17 beta 3, when I go to the Do Not Disturb focus mode, most of my apps are gone. Perhaps they're just hidden. I can't figure out how to show or hide apps in specific focus modes. Is anyone else seeing this? What's the fix?
Posted Last updated
.
Post marked as solved
3 Replies
969 Views
I have a view that shows a table and 4 buttons. Each button allows the user to step forward and backwards through the data. Buttons are enabled and disabled based on where you are in the data. If you are less than 200 values to the end of the data for example, the "Page Down - 200" button is disabled. Everything works fine if the mouse is used to run the code associated with each button. But in this case I think the buttons never get focus. Focus I think remains with the sidebar content item that brought up the table view (am using a navigation split view). If I tab over to the page down 200 button and use the space bar to run its associated code I get the error "AttributeGraph: cycle detected through attribute 864480". I think the problem lies with attempting to disable the button while it has focus but am not 100% sure. I have tried to change the focus prior to disabling the button but I get the same error. I think there is some fundamental that I am missing. Below is my table view along with the page down 200 button view. struct DataTable: View { @FocusState var buttonWithFocus: Field? @ObservedObject var vm: ButtonsViewModel = ButtonsViewModel.shared @State private var hasAppeared = false var closingValues: [TradingDayClose] var heading: String = "" init(fundName: String, closingValues: [TradingDayClose]) { self.heading = fundName self.closingValues = closingValues } var body: some View { HStack { Spacer() .frame(width: 150) GroupBox(heading) { if hasAppeared { Table (of: TradingDayClose.self) { TableColumn("") { closingValue in Text(dateToStringFormatter.string(from: closingValue.timeStamp!)) .id(closingValue.timeStamp!) .textFormatting(fontSize: 14) .frame(width: 100, alignment: .center) } // end table column TableColumn("") { closingValue in Text(String(format: "$ %.2f", closingValue.close)) .textFormatting(fontSize: 14) .frame(width: 100, alignment: .center) } // end table column } rows: { ForEach((closingValues.indices), id: \.self) { index in if vm.showData[index] == true { TableRow(closingValues[index]) } } } .focusable(false) .frame(width: 250) .overlay { let tempValue1: String = "Date" let tempValue2: String = "Closing Value" Text(tempValue1).position(x: 63, y: 15) .textFormatting(fontSize: 16) Text(tempValue2).position(x: 180, y: 15) .textFormatting(fontSize: 16) } } // end has appeared } // end group box .groupBoxStyle(Table2GroupBoxStyle()) Spacer() .frame(width: 50) VStack { Spacer() .frame(height: 100) Form { Section { ButtonUp25(closingValuesCount: closingValues.count) .focused($buttonWithFocus, equals: .btnUp25) ButtonUp200(closingValuesCount: closingValues.count) .focused($buttonWithFocus, equals: .btnUp200) } header: { Text("Page Up") } Spacer() .frame(height: 20) Section { ButtonDown25(closingValuesCount: closingValues.count) .focused($buttonWithFocus, equals: .btnDn25) ButtonDown200(buttonWithFocus: $buttonWithFocus, closingValuesCount: closingValues.count) .focused($buttonWithFocus, equals: .btnDn200) } header: { Text("Page Down") } } // end form .navigationTitle("Data Table") Spacer() .frame(height: 100) } // end v stack Spacer() .frame(width: 50) } // end h stack .onAppear { vm.InitializeShowData(closingValueCount: closingValues.count) vm.InitializeIndexes() vm.InitializeButtons() for i in vm.startIndex...vm.endIndex { DispatchQueue.main.asyncAfter(deadline: .now() + vm.renderRate * Double(i)) { vm.showData[i] = true } // end dispatch queue main async } hasAppeared = true } } // end body } // end struct struct ButtonDown200: View { var buttonWithFocus: FocusState<Field?>.Binding @ObservedObject var vm: ButtonsViewModel = ButtonsViewModel.shared var closingValuesCount: Int var body: some View { Button("Page Down - 200") { for i in vm.startIndex...vm.endIndex { vm.showData[i] = false } vm.startIndex = vm.startIndex + 200 vm.endIndex = vm.startIndex + 24 var j: Int = 0 for i in vm.startIndex...vm.endIndex { DispatchQueue.main.asyncAfter(deadline: .now() + vm.renderRate * Double(j)) { vm.showData[i] = true } j = j + 1 } if (closingValuesCount - 1) - (vm.startIndex + 200) < 25 { // buttonWithFocus.wrappedValue = .btnDn25 vm.pageDownDisabled200 = true } if vm.startIndex > 24 { vm.pageUpDisabled25 = false } if vm.startIndex - 200 >= 0 { vm.pageUpDisabled200 = false } } .controlSize(.large) .buttonStyle(.borderedProminent) .disabled(vm.pageDownDisabled200) } }
Posted
by ChrisMH.
Last updated
.
Post not yet marked as solved
0 Replies
567 Views
Hello, Ive had some feedback from a customer asking that when he uses my app to start the mindfulness focus. Ive tried this on iPhone and setup the mindfulness focus to start when my app is open and that works fine, however this is not mirrored on my Apple Watch where the app is used. Upon opening the Apple Watch app the focus does not turn on. How can I get this working? Thank you.
Posted Last updated
.
Post not yet marked as solved
0 Replies
625 Views
Since iOS 16, in third-party apps, the camera does not focus on objects at a distance of 10 to 12 cm. This renders all apps that require close-range focus, such as barcode scanners, QR code readers, and others, completely obsolete and non-functional. You can verify this by opening the camera from apps like Instagram or WhatsApp, for example. It does not focus at close range. As a developer, I have not found a solution yet. Can someone help me with this issue starting from iOS 16? Will there be any Apple update to fix this problem? I have tested this with an iPhone 14 and iPhone S6, both running iOS 16...
Posted
by jorgeluis.
Last updated
.
Post not yet marked as solved
0 Replies
554 Views
Desde iOS 16, en Apps de terceros, la cámara no hace foco a objetos con una distancia de 10 a 12 cm. Esto hace que todas las Apps que necesitan del enfoque a corta distancia, como scanners de barras, QR y otros, queden totalmente obsoletos, sin funcionar. Pueden comprobarlo abriendo la cámara desde Instagram o WhatsApp, por ejemplo. No hace foco a corta distancia. Aún no he encontrado una solución como desarrollador. Alguien puede ayudarme con este problema a partir de iOS 16? Habrá alguna actualización de Apple para solucionar este problema? Lo he testeado con iPhone 14 y iPhone S6. Ambos con iOS 16..
Posted
by jorgeluis.
Last updated
.
Post not yet marked as solved
1 Replies
786 Views
Hello Apple Developer Community, I am currently working on a macOS application and would like to seek your guidance on programmatically activating and deactivating the Focus Mode (formerly known as Do Not Disturb) feature on macOS. The primary objective is to provide users with an option to manage their focus and prevent interruptions from notifications during specific periods while using the application. To achieve this functionality, I would like to be able to: Detect the current status of Focus Mode on the user's macOS system. Activate Focus Mode programmatically when certain conditions within the application are met. Deactivate Focus Mode programmatically when the user exits the specific conditions within the application. I understand that there might be security or privacy concerns related to programmatically controlling the Focus Mode on macOS. However, I would appreciate any guidance or suggestions on how to achieve this functionality in a way that adheres to Apple's guidelines and best practices. If there are any relevant APIs, frameworks, or documentation that could be of assistance, kindly point me in the right direction. Additionally, if there are alternative methods to accomplish a similar outcome, I am open to exploring those options as well. Thank you for your time and expertise. I look forward to learning from your collective knowledge and experience in order to enhance the user experience of my application. Best regards
Posted
by anislz.
Last updated
.
Post not yet marked as solved
0 Replies
562 Views
hi. The event that gives focus to input box without user action does not apply when page opens on iPhone mobile web, is this is ios policy?
Posted Last updated
.