wit-ai / wit-ios

Wit.ai iOS client
Other
222 stars 71 forks source link

Canceling instead of Stop() #57

Closed thediary closed 5 years ago

thediary commented 8 years ago

How could one "cancel" the witSDK instead of using the Stop() function which looks for an intent and calls the rest of the api calls? Our app needs to be able to stop the witRecorder (i'm assuming) without sending a request to the wit api. Does this make some sense? Anyone have any suggestions or perhaps a method could be added to the sdk if needed?

thediary commented 8 years ago

In case it helps, the dictation screen in our app is a modal view controller, so when it gets dismissed, we need to be able to stop the dictation without sending a response to wit

dsposito commented 8 years ago

@thediary Canceling the request is not currently supported in the iOS SDK from what I can tell.

I do have a pull request (#56) that makes the recordingSession property publicly accessible from the main Wit shared instance. If that PR is approved, I believe something like this could be added to Wit.h/m:

- (void)cancel
{
    [[Wit sharedInstance].recordingSession.recorder stop];
}