r/iOSProgramming • • 2d ago

Question Niche question, anyone successfully built a crossplatform (ios+macos) app that shares one entry for Focus mode?

This is super specific. But just in case anyone came across this. I built a cross platform app (iOS + macos) using the default template and everything is done with SwiftUI. Seems look to work great. Except for one thing.

For whatever reason, even though the two apps have the same BundleIdentifier they are treated as two separate apps in terms of Focus mode's allowed apps. And the worst thing is that you can add the iOS app to say "Work focus" and separately add the macOS app to also the same Work focus, but it will conflict and the OS will choose to keep one. So only ever one side will be "allowed" in work focus mode. What is the right way to tell the OS that they are really the same app?

3 Upvotes

4 comments sorted by

1

u/fidgiesapp 2d ago

I haven't seen a way to make Focus treat the iOS and macOS builds as one allowed app, since each platform keeps its own list. What may help is adding a Focus Filter with SetFocusFilterIntent, so the app itself reacts when a Focus turns on and doesn't depend only on the allowed-apps list. That at least lets you control notifications and content per device from one shared piece of code. It's worth filing a Feedback Assistant report about the duplicate-entry conflict too, since the one-or-the-other behavior sounds like a bug.

1

u/[deleted] 8h ago

[removed] — view removed comment

1

u/AutoModerator 8h ago

Hey /u/ElegantShallot5927, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.