Giter VIP home page Giter VIP logo

assistantplus-developer-guide's Introduction

AssistantPlus Developer Guide

Lifecycle of Plugin:

  1. Principal class of bundle is loaded and initWithPluginManager: is called. Here is where you should register your commmands and snippets.

  2. User says something to Siri and your commands' handleSpeech:withTokens:withSession: method is called. If you want your plugin to handle the query then you should return YES, otherwise return NO. You should try to return an answer as soon as possible and then do any heavy work asynchronously.

  3. If you've returned YES, then you can start sending views to the current session, either your own custom snippets or the default text snippets.

  4. Once you're done you should call sendRequestCompleted on the current APSiriSession to end the request. If you don't do this the session could potentially timeout and Siri will give the user an error message.

Sending Views:

Views can be sent to the current Siri session in two ways:

You can queue up the views in an NSArray and send them all at once using sendAddViews:

      NSMutableDictionary *textSnippet = [session createTextSnippet:@"Here's what I found..."];
      NSMutableDictionary *customSnippet = [session createSnippet:@"SpotifySearchResultsViewController" properties:@{@"tracks" : [trackResults subarrayWithRange:NSMakeRange(0, MIN(trackResults.count, 5))],
                                                                                        @"albums" : [albumResults subarrayWithRange:NSMakeRange(0, MIN(albumResults.count, 5))],
                                                                                        @"artists" : [artistResults subarrayWithRange:NSMakeRange(0, MIN(artistResults.count, 5))]}];
      [session sendAddViews:@[textSnippet, customSnippet]];
      

Or, you can send the views one by one using sendTextSnippet: and sendCustomSnippet:

      [session sendTextSnippet:@"Here's what I found..." temporary:NO scrollToTop:NO dialogPhase:@"Summary"];
      [session sendCustomSnippet:@"SpotifySearchResultsViewController" withProperties:@{@"tracks" : [trackResults subarrayWithRange:NSMakeRange(0, MIN(trackResults.count, 5))],
                                                                                      @"albums" : [albumResults subarrayWithRange:NSMakeRange(0, MIN(albumResults.count, 5))],
                                                                                      @"artists" : [artistResults subarrayWithRange:NSMakeRange(0, MIN(artistResults.count, 5))]}];
```

### Custom Snippets:
Your custom snippet class must be a subclass of UIViewController and conform to the APPluginSnippet protocol. If you choose to not implement initWithProperties: then you will not be able to receive any properties you send your snippet using sendCustomSnippet:withProperties:

assistantplus-developer-guide's People

Contributors

zaidelkurdi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

assistantplus-developer-guide's Issues

Multi Level commands?

Hi there!

A suggestion:
It would be great if you'd support multi level commands, as Illustrated with siris mail feature below:

I ask: write an eMail to bla
Siri responds: What do you want me to write?
I respond with the text
Siri asks: do you want me to send it?
I say yes and the eMail will be sent.

Thanks! :)

Best,
Julian

Enable Passthrough yet control response text?

I am successfully able to handle a response, but I want to able to control what siri replies, and let her reply with a view that she was originally supposed to reply with. How would I got about doing that?

For example:
I would say, "Siri what is the weather for this week?"
AssistantPlus would reply, "K, here's your forecast, later..."
Siri would originally say, "Here's the forecast for the week..." (but i don't want her to say that)
Siri would reply with the weather view...

Confused

Hi. I've been working trying to figure this out for the past three hours. Pardon if I am a bit terse.
Your developer guide doesn't give any instructions for compilation. I tried making my own bundle from scratch and copying the Makefile lines from the .plist but all I can make is a .bundle.

Dismiss Siri after Plugin Completes

I haven't been able to find a way to dismiss Siri after the plugin completes.

I have tried using the private framework AccessibilityUtilities and importing the AXSpringBoardServer but I must be doing it wrong as it won't compile.

I have also tried simulating a home button press with SBUIController but that does not seem to have any effect.

Any ideas?

Prompt for another response

Do you have any method to prompt for further input? For example if i choose to send a text or create a reminder with Siri, I get prompted to say what i would like it to be. I would love to have similar functionality for a plugin I am developing. Do you see this being a possibility?

What I would want is a way to prompt the user and return the tokens.

Configure AssistantPlus with SSH

Hi,

thank a lot for this great app. I have just one question:

Is it possible to add and edit command for Assistant+ with a Texteditor and store them on the Iphone?

Thanks a lot.

Cu kami

SpotifySearchCommands view issue

Hi,
i'm trying to compile your plugin and it works well if I play something but if I try to search for something, I can't tap any of the results that should brings me in spotify as your cydia version does. Can you help me figure out what's the problem? thanks in advance!
img_1173
p.s. i'm trying all this to translate the plugin in Italian ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.