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.