问题
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