algolia / voice-overlay-ios

🗣 An overlay that gets your user’s voice permission and input as text in a customizable UI
https://alg.li/voice
MIT License
544 stars 62 forks source link

iOS 9 Support #3

Closed IchordeDionysos closed 5 years ago

IchordeDionysos commented 5 years ago

Is it possible to allow the use of iOS 9 as a minimum deployment target?

spinach commented 5 years ago

Hey @IchordeDionysos,

Unfortauntely we use Apple's SFSpeechRecognizer from Apple which has a minimum deployment target of iOS 10. Else we can't do speech recognition. Sorry about this!

IchordeDionysos commented 5 years ago

Would it be possible to annotate classes/functions which can be used with @available as done here: https://github.com/algolia/voice-overlay-ios/blob/c46882902e1e822640c38861c218aa4c26c82062/VoiceOverlay/Controllers/SpeechController.swift#L22 And then allow a lower deployment target as this would allow us, developers, to give users an incremental enhancement based on their iOS version.

E.g. users running on up to iOS 9.0, have no option for voice search, users with a rather proper iOS version get speech recognition.

spinach commented 5 years ago

I see what you mean. The thing is that we feel that the library will not really be useful without the speech recognition.

Can you tell us what use case you're thinking of for iOS 9 users? What would you use the library for?

Also, note that in a coming version of the library, we're thinking of abstracting away the SpeechController, so that anyone can inject any speech recognizer. This might help with supporting lower iOS target since you will be able to inject any kind of speech recognizer/

IchordeDionysos commented 5 years ago

I would only allow the use of text search and would NOT use this library, but to give users a progressive enhancement based on their iOS Version, it's much simpler to set a lower library deployment target and annotate the available functions with the @available decorator.

Maybe there is a way with a deployment target of iOS 9.0 to include this library only when users have iOS 10.0 or higher, but I tried so many different stuff, like optional dependencies, but I couldn't find a working solution.

spinach commented 5 years ago

Okay I see what you're saying. I will mark all the classes as @available and reduce deployment target to 9.0. Re-opening this issue and will keep you updated about the progress

spinach commented 5 years ago

Deployment target of 9.0 has just been released in pod version 1.0.0-beta2. Go ahead and run pod update to get the latest version from the spec repo.