0

I want my app to basically know when the user spoke to the device and switched to my app (or launched it). Something like:

“Hey Siri, ”

Or

“OK Google, ”

That’s it. From there, my app would automatically emit a prompting sound and enable the microphone for eg more complex commands, which I plan to use OpenEars or other onboard AI for — no need to send to server.

But how do I know on iOS and Android that the app was put into the foreground by Siri or Google Assistant?

Gregory Magarshak
  • 1,883
  • 2
  • 25
  • 35
  • On iOS, you don't if the user just used the generic "open myApp" command – Paulw11 Mar 05 '20 at 19:34
  • https://stackoverflow.com/questions/44278969/android-app-launch-source – Krystian G Mar 05 '20 at 19:47
  • Is that answer for both ios and android? – Gregory Magarshak Mar 05 '20 at 20:00
  • Also: [Determining whether iOS application was launched via Siri](https://stackoverflow.com/q/19149587/295004) – Morrison Chang Mar 05 '20 at 20:13
  • On iOS, you can add SiriKit to the app and only if the user says "Hey Siri, Open SomeApp" it will open. Otherwise it doesn't need to open and the extension is ran. If your app is being interacted with by SiriKit, your will get a delegate called within your SiriKit extension so you know whether or not the user is talking to your app vs. another app.. The delegate (in the intent) call doesn't mean your app was opened, but it does mean the user is asking for suggestions or answers from your app.. – Brandon Mar 05 '20 at 20:32
  • @Brandon could you please add some reference to what you say? I didn't find anything like this on the internet and I'm really interested – Christian Vincenzo Traina Jun 03 '20 at 17:42

0 Answers0