简体   繁体   English

iOS 15对焦模式开发

[英]iOS 15 focus mode development

We can set up a focus status with customized turning on time and turning off time.我们可以通过自定义的开启时间和关闭时间来设置焦点状态。 I'd like to be notified when I am in my own app.当我在自己的应用程序中时,我希望收到通知。 Unfortunately INShareFocusStatusIntentHandling was not called when a system notification "Focus on" came out.不幸的是,当系统通知“Focus on”出来时,没有调用 INShareFocusStatusIntentHandling。 Anybody know some solutions or ideas about it.任何人都知道一些解决方案或想法。 Thanks ahead!提前谢谢!

According to https://developer.apple.com/forums/thread/682143 you need to implement an Intents Extension from your app and have that extension share the results to the main app via UserDefaults or some other method.根据https://developer.apple.com/forums/thread/682143 ,您需要从您的应用程序中实现一个 Intents 扩展,并让该扩展通过 UserDefaults 或其他方法将结果共享给主应用程序。 You cannot observe the focus state changes directly in your app.您无法直接在您的应用程序中观察焦点 state 的变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM