Is there a way to detect if user was already in your app before launching Siri?

*爱你&永不变心* 提交于 2019-12-24 10:49:02

问题


Is this possible to know inside my Siri intent handler if the user was in my app before launching Siri?


回答1:


You can use App Groups to share data between your app's main target and your Siri intent handler. You could simply store a Bool in UserDefaults indicating whether your app was already launched or not, then access the same value using App Groups from your Siri intent handler.

For more information on App Groups, see the App Extension Programming Guide.



来源:https://stackoverflow.com/questions/56996618/is-there-a-way-to-detect-if-user-was-already-in-your-app-before-launching-siri

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!