0

Basically, I want my app to be voice activated If user asks my app to open then it should open if the user says something it has to be typed in the textbox if the user says to click on a button it has to be done if the user wants to be voice read then it should read it out. basically, I would like to read the user command sometimes if possible in the app and serve my user base the best

There is no much documentation available there,,, so I thought of asking the question here

Raksha Saini
  • 604
  • 12
  • 28
Rajan M
  • 345
  • 3
  • 22

2 Answers2

0

This is not possible. You cannot use Siri with apps for anything else than what is implemented in the SiriKit framework and SiriKit does not provide any methods for just opening your app without actually handling an intent and custom commands are also not supported at the moment.

For dictation you can use the Speech framework and for the system to "read out" something from your UI, you need to support VoiceOver, which is part of Accessibility.

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
  • so you mean to say I can interact to app via Sirikit but just intents ... so lets submit a request ... then If I had a intent for submit a request then from iOS siri user can say submit a request and my app can catch and show the UI screen to user directly kind of like short cut .... – Rajan M Aug 14 '17 at 15:20
  • What do you mean by "request"? [This](https://developer.apple.com/sirikit/) is what you can do using `SiriKit`. You cannot accept custom "requests" and it is not a "shortcut" for opening your app. The user can ask `Siri` to do something that an Intent supports (such as playing music, starting a workout, sending money, etc.) and once that Intent is handled by your app, Siri can prompt the user to open the app. But whatever is not supported by an intent cannot be done using Siri. – Dávid Pásztor Aug 14 '17 at 15:25
  • can I have my intent open my app to show view controller – Rajan M Aug 14 '17 at 15:28
  • After handling an Intent, yes. Without handling an intent, no. – Dávid Pásztor Aug 14 '17 at 15:28
  • if not my app is opened ... can I have user say log out and sign out in my app in background.. – Rajan M Aug 14 '17 at 15:29
  • As I have stated several times already, **no**. There is no intent for signing in, so this cannot be done using Siri. – Dávid Pásztor Aug 14 '17 at 15:29
  • I can have a intent like... sign out x .... and my app catches and it opens the app .. upon opening the app can I sign out as subsequent action – Rajan M Aug 14 '17 at 15:31
  • As I have already stated several times, **you cannot create your own intents**, you can only use the existing ones. Have a look at the documentation I have linked and see for yourself what intents exist. – Dávid Pásztor Aug 14 '17 at 15:32
  • 1
    Now it makes sense ? – Rajan M Aug 14 '17 at 15:35
0

My purpose is to open secret screen (test screen) into my app. Best way is to display a normally hidden button, I use a fake messaging with Siri. App is ok for Siri request but no other special code is necessary, I just add appDelegate.m method with a postNotification, somewhere some code will append a button

- (BOOL)application:(UIApplication *)application willContinueUserActivityWithType:(NSString *)userActivityType {
    if ([userActivityType isEqualToString:@"INSendMessageIntent"]) {
       [[NSNotificationCenter defaultCenter] postNotificationName:@"modeTest" object:nil];
    }
    return YES;
}

Now ask Siri "Send message with 'AppName' " a view from my IntentWiewController.m is display, you can abord process by touching screen, application is running now but Notification is send, some process can easily be done like adding any secret control. Next run will hide button.

Pautex
  • 51
  • 5