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

Posts under Focus tag

53 Posts

Post

Replies

Boosts

Views

Activity

Programmatic Activation and Deactivation of Focus Mode (Do Not Disturb) on macOS
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
1
0
1.2k
May ’23
Read the sleep schedule using HealthKit
Using the Health app, the user can define a bedtime and a wake up time. Can we get this data using the HealthKit framework? I'm not interested in the actual time the user spent in bed, but in the time the user scheduled to go to bed, so different kinds of data. Unfortunately I could not find anything in the documentation: https://developer.apple.com/documentation/healthkit/data_types https://developer.apple.com/documentation/sirikit/infocusstatus
0
2
1.4k
Apr ’23
Application not listed in Focus filter Settings if we build using XCode 14.1
We have implemented the focus filter using the AppEntity param type, Our app is visible in focus filter settings if we build/run with XCode 14 or 14.0.1. But the same is not if we run using the latest XCode 14.1. Note: Our code base has both Objective C and Swift and minimum support for iOS 11. Previously(with XCode 14), faced crash issues earlier iOS 16 devices as the AppIntents library was not loaded which is fixed by a workaround including the "AppIntents" library as optional/weak under link binary with Libraries.
1
0
1.3k
Dec ’22
Autonomy over Notification Sounds ios 16.1
I use iPhone 12 on iOS 16 and I would like to be able to assign specific notification sounds to individual applications. I run a few apps with varying degrees of importance to me, and I require sound notifications for all of them. If I was able to assign specific sounds to specific notifications it would increase my productivity by reducing the amount of time I have to check my phone. Currently I enjoy the feature of assigning different tones for phone calls, sms, and email and would love it if this feature was available for non-native iOs apps. If this feature became available on iOS 16.1 it would be a real game changer for productivity and screen time. Thanks in advance for any response on the likelihood of this feature becoming available in the future ☺️
0
0
953
Nov ’22
iOS 16.1 is setting Personal Focus Smart Activation to be on by default - is there a way an app can detect if a focus mode currently active or not
As a user, I've been hit several times missing calls and notifications when I was expecting them. I've just figured out why that is - its because iOS 16.1 is automatically setting Smart Activation to on for Personal Focus. So I kept missing phone calls because the iPhone had been turning on Personal Focus when I was unaware it was. As well as blocking calls, it also doesn't display any notification. (I never use this focus feature, I didn't even know it existed until now, so for it to be enabled by default is absolutely ridiculous behavior. This is iOS 16.1 beta yet but its so close to the release date of 16.1 it must be the final behavior). Now with my developer hat on, I would like my application to detect if notifications are being suppressed due to a focus's do not disturb. Is there an API available for an app to determine if a notification has not been displayed to the user due to this for non communication type apps? Just a regular app that receives user-directed push messages and needs to know if they were displayed to the user.
0
0
1.4k
Oct ’22
How to force focus engine to focus first item in HStack when this HStack is about to get focused?
In tvOS Application using SwiftUI Assume there are list of HStacks, where each HStack has 10 elements (say thumbnails). Initially focus will be on the 1st HStack 1st element, now if I scroll to tenth element in the same HStack and Swipe downward in siri remote then How to force focus to go to 1st element in next HStack in tvOS?
2
3
1.2k
Oct ’22
focus filter could not select parameter
I implemented focus filter in my app, where there is only one parameters with dynimac option provider. when i ran the project, i can see the app in the focus filter, but when i try to choose the parameter in my app's focus filter page, it appeared a loading then disappeared, which was supposed to pop up a page for me to choose. it's also weird in my project to print log like: [Execution] Could not find an intent with identifier 'DemoFilter' DemoFilter is a focus filter i created in a demo project, while it has nothing to do with my another project. would it be some kind of bug in xcode14 beta6?
0
0
851
Aug ’22
Is Focus Ring broken for InstGrouped Style TableView in MacCatalyst?
Hi, I've assigned contextual menu to my tableview rows which seems to focus cells background with blue ring in MacCatayst. If tableview style is Plain or Grouped, it focus ring appear as it should but in InsetGrouped type tableview, it seems to be broken. I've tried disabling the focus with : func tableView(_ tableView: UITableView, canFocusRowAt indexPath: IndexPath) -> Bool { return false } And tableView.selectionFollowsFocus = false But no luck disabling it. Anyone has any Idea about this behaviour ?
1
0
1.3k
Jun ’22
Change focus mode to Work with applescript
Is here someone, who could provide me a simple script? My goal is to turn on the Work focus mode with applescript, or with applescript through siri shortcuts. (the main thing is, i need the script code definetly)
Replies
1
Boosts
0
Views
1.6k
Activity
May ’23
Programmatic Activation and Deactivation of Focus Mode (Do Not Disturb) on macOS
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
Replies
1
Boosts
0
Views
1.2k
Activity
May ’23
page load input box focus on
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?
Replies
0
Boosts
0
Views
778
Activity
May ’23
Read the sleep schedule using HealthKit
Using the Health app, the user can define a bedtime and a wake up time. Can we get this data using the HealthKit framework? I'm not interested in the actual time the user spent in bed, but in the time the user scheduled to go to bed, so different kinds of data. Unfortunately I could not find anything in the documentation: https://developer.apple.com/documentation/healthkit/data_types https://developer.apple.com/documentation/sirikit/infocusstatus
Replies
0
Boosts
2
Views
1.4k
Activity
Apr ’23
SwiftUI + Problems with focus on TVOS after update to 16.4
All views in my SwiftUI TVOS application stopped working correctly after TVOS update to 16.4. Gestures recognition and buttons from Siri remote work, but elements in my views lose or do not set in focus (can't eve press or select any button). What ways can be to solve this issue ?
Replies
1
Boosts
2
Views
1.1k
Activity
Apr ’23
Manual Focus in ARKit
I need to manually set focus or dynamically adjust the focus without using the autofocus logic, but a custom logic. Is there a way to do that in ARKit, if not can we use the same controls in AVFoundation for ARKit high resolution capture?
Replies
0
Boosts
0
Views
768
Activity
Apr ’23
Application not listed in Focus filter Settings if we build using XCode 14.1
We have implemented the focus filter using the AppEntity param type, Our app is visible in focus filter settings if we build/run with XCode 14 or 14.0.1. But the same is not if we run using the latest XCode 14.1. Note: Our code base has both Objective C and Swift and minimum support for iOS 11. Previously(with XCode 14), faced crash issues earlier iOS 16 devices as the AppIntents library was not loaded which is fixed by a workaround including the "AppIntents" library as optional/weak under link binary with Libraries.
Replies
1
Boosts
0
Views
1.3k
Activity
Dec ’22
Autonomy over Notification Sounds ios 16.1
I use iPhone 12 on iOS 16 and I would like to be able to assign specific notification sounds to individual applications. I run a few apps with varying degrees of importance to me, and I require sound notifications for all of them. If I was able to assign specific sounds to specific notifications it would increase my productivity by reducing the amount of time I have to check my phone. Currently I enjoy the feature of assigning different tones for phone calls, sms, and email and would love it if this feature was available for non-native iOs apps. If this feature became available on iOS 16.1 it would be a real game changer for productivity and screen time. Thanks in advance for any response on the likelihood of this feature becoming available in the future ☺️
Replies
0
Boosts
0
Views
953
Activity
Nov ’22
iOS 16.1 is setting Personal Focus Smart Activation to be on by default - is there a way an app can detect if a focus mode currently active or not
As a user, I've been hit several times missing calls and notifications when I was expecting them. I've just figured out why that is - its because iOS 16.1 is automatically setting Smart Activation to on for Personal Focus. So I kept missing phone calls because the iPhone had been turning on Personal Focus when I was unaware it was. As well as blocking calls, it also doesn't display any notification. (I never use this focus feature, I didn't even know it existed until now, so for it to be enabled by default is absolutely ridiculous behavior. This is iOS 16.1 beta yet but its so close to the release date of 16.1 it must be the final behavior). Now with my developer hat on, I would like my application to detect if notifications are being suppressed due to a focus's do not disturb. Is there an API available for an app to determine if a notification has not been displayed to the user due to this for non communication type apps? Just a regular app that receives user-directed push messages and needs to know if they were displayed to the user.
Replies
0
Boosts
0
Views
1.4k
Activity
Oct ’22
How to force focus engine to focus first item in HStack when this HStack is about to get focused?
In tvOS Application using SwiftUI Assume there are list of HStacks, where each HStack has 10 elements (say thumbnails). Initially focus will be on the 1st HStack 1st element, now if I scroll to tenth element in the same HStack and Swipe downward in siri remote then How to force focus to go to 1st element in next HStack in tvOS?
Replies
2
Boosts
3
Views
1.2k
Activity
Oct ’22
focus filter could not select parameter
I implemented focus filter in my app, where there is only one parameters with dynimac option provider. when i ran the project, i can see the app in the focus filter, but when i try to choose the parameter in my app's focus filter page, it appeared a loading then disappeared, which was supposed to pop up a page for me to choose. it's also weird in my project to print log like: [Execution] Could not find an intent with identifier 'DemoFilter' DemoFilter is a focus filter i created in a demo project, while it has nothing to do with my another project. would it be some kind of bug in xcode14 beta6?
Replies
0
Boosts
0
Views
851
Activity
Aug ’22
how to prevent app show up when user clicks notification
Hi, I want to prevent user's MacOS to open app itself when user click its notification. how can I do that? it there any API support that? thanks!
Replies
0
Boosts
0
Views
1.3k
Activity
Jun ’22
Is Focus Ring broken for InstGrouped Style TableView in MacCatalyst?
Hi, I've assigned contextual menu to my tableview rows which seems to focus cells background with blue ring in MacCatayst. If tableview style is Plain or Grouped, it focus ring appear as it should but in InsetGrouped type tableview, it seems to be broken. I've tried disabling the focus with : func tableView(_ tableView: UITableView, canFocusRowAt indexPath: IndexPath) -> Bool { return false } And tableView.selectionFollowsFocus = false But no luck disabling it. Anyone has any Idea about this behaviour ?
Replies
1
Boosts
0
Views
1.3k
Activity
Jun ’22