0

I have implemented INPauseWorkoutIntent, INStartWorkoutIntent or INResumeWorkoutIntent in my app in IOS 12 and XCode 10. I can use the commands correctly with using home button to open Siri but what I need is Hand off. I mean, I just want to say "Pause workout" and it should pause. I also don't want to use watch. How to achieve that, what am I missing?

Note: - (id)handlerForIntent:(INIntent *)intent not called anyways.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
birdcage
  • 2,638
  • 4
  • 35
  • 58

1 Answers1

0

I believe you already have implemented resolve, confirm, and handler functions comforting to respective protocols.

I just check response code for workout and they have .continueInApp response code. That being said, I believe you can pass response with code .continueInApp and save whatever parameters you have to use in UserActivity in handler's completion. UserAcitivity will be passed to application: continueUserActivity function in AppDelegate; so you can pause it from there.

If handlerForIntent is not called, then I believe intent is not understood by Siri

Bubu
  • 651
  • 8
  • 25
  • handlerForIntent is not called at all. what might be the reason why its not called? – birdcage Nov 08 '18 at 19:54
  • In Info.plist, did you define which Intents are used in IntentExtension's plist? You have to define all the Intent you use in plist's NSExtension.https://developer.apple.com/documentation/sirikit/creating_an_intents_app_extension – Bubu Nov 08 '18 at 19:56