![]() Occasionally iOS stops responding to donated shortcuts for some reason. ![]() Once Siri starts on your phone you can test your shortcut there, or switch to the Shortcuts app and test it there as well. When asked to choose an app to run click Siri. However, you can share user defaults between both targets using App Groups.Ħ) To test and debug your Intent Extension, choose the intent target and click run. I basically just moved a lot of the shared core logic into a new folder called “Shared” and added these files to both targets (main app and intent extension). ( BOOL ) application :( UIApplication * ) application continueUserActivity :( NSUserActivity * ) userActivity restorationHandler :( void ( ^ )( NSArray > * restorableObjects )) restorationHandler Keep in mind that the Intent Extension is a completely separate module, so if you need to access code from your main app you may need to refactor and share the code between the two targets. your app identifier followed by a screen name). Choose an appropriate “activity type” (e.g. At first I tried doing this manually but that does not seem to work.īe sure to wrap your code with 12.0, *) if your app supports older versions of iOS. The view controller automatically invokes becomeCurrent and resignCurrent for us. IMPORTANT: Assign your NSUserActivity to the view controller’s built-in userActivity property.Set requiredUserInfoKeys (I’m not sure if this step is required).Add any userInfo that you need to be able resume the screen later.Make sure you enable eligibleForPrediction.Construct a NSUserActivity in viewDidLoad using an appropriate “activity type” string.In my case, the goal was to donate a user activity whenever the user opens a remote in the app, and to donate an interaction when they trigger an action inside a remote.ġ) Choose a screen where you want to donate a user activity and create an NSUserActivity. This tutorial will cover all required steps for donating and implementing both of the above. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |