wit-ai / wit-ios

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

Wit is not called from WITMicButton anymore when RecordPermission is not granted. #44

Closed Enceradeira closed 9 years ago

Enceradeira commented 9 years ago

I had the problem that WITMicButton would call into Wit even when the RecordPermission was Denied or Undeterminded. This resulted in an error being returned in witDidGraspIntent (I assume because invalid data would have been uploaded to Wit). The RecordPermission can't be requested outside of WITMicButton because that would trigger the permission alert even though the user didn't press the mic button.

This fix solves the problem by not calling into to Wit when the RecordPermission is not granted.

Catacola commented 9 years ago

Another nice catch! Thanks for the second great PR. I'll roll this into our upcoming release.