A Swift Package Manager distribution for enx_voice_iOS framework that automatically includes Starscream and SwiftProtobuf for iOS Voice bot.
- iOS 15.0+
- Xcode 12.0+
- Device-only builds (no simulator support)
When you add this package, you automatically get:
- ✅ enx_voice_iOS - Main iOS SDK framework
- ✅ Starscream - webSocket Freamwork
- ✅ SwiftProtobuf - SwiftProtobuf Freamwork
Add this package to your iOS project:
dependencies: [
.package(url: "https://github.com/EnableX/enx_voice_iOS.git", from: "1.0.0")
]Or in Xcode:
- Go to File → Add Package Dependencies...
- Enter the repository URL:
https://your-repo-url.git - Select the version and add to your target
import enx_voice_iOS
// Starscream and SwiftProtobuf is automatically available through enx_voice_iOS// Initialize your Voice Bot functionality
// (Add your specific usage examples here)- Package Name:
enx_voice_iOS(appears as dependency name) - Product:
enx_voice_iOS(single library containing both frameworks) - Auto-Dependencies:
Starscream and SwiftProtobuf,is automatically fetched from https://github.com/daltoniam/Starscream.git and https://github.com/apple/swift-protobuf.git
- Platforms: iOS 15.0+
- Architectures: arm64 (device-only)
- No Simulator Support: Both frameworks are optimized for device builds only
- This package automatically resolves and includes Starscream and SwiftProtobuf when added to projects
- Users only need to add the enx_voice_iOS package
- frameworks is pre-compiled XCFrameworks for optimal performance
Go to your class, where you wanted to implement the Enablex Voice Bot feature, import the libraray
import enx_voice_iOSCreate the objects for required SDK classes
var enxVoice : EnxVoiceClient!This is the object of EnxVoiceClient class, all Enablex Voice Bot based functions/mothods need to call through this object. Once you are connected to the EnableX Voice Bot , you will receive didCallConnected callBack with the reference of EnxVoiceClient to be assign to the enxVoice object.
How to Connect with EnableX Voice Bot
You need to call connect method as code given below -
enxVoice = EnxVoiceClient(withNumber: "911100123457", forCallBack: self)
enxVoice.connect(withToken: (responseValue["token"] as! String))
Function Parameters
tokenis must be a valid EnableX session token as string.delegateis instance of class where you receive events notifications.withLanguagethis is optional to selected prefered loanguage for bot to speak
Callbacks
-
On getting connected with EnableX Voice Bot, following callbacks are received:
func didStatus(_ status: enx_voice_iOS.EnxVoiceState) func didCallConnected() -
On failing to connect with Enablex Voice Bot, following callback are received:
func didError(_ error: String) -
On being disconnected from EnableX Voice Bot, following callbacks are received:
func didCallDisconnected() -
On Bot or user speaking notification , following callbacks are received:
func didUserSpeaking(_ isSpeaking: Bool) func didBotSpeaking(_ isSpeaking: Bool) -
On user mute/unmute notification , following callbacks are received:
func didMuteStateChanged(_ isMuted: Bool)
Note: Developers must implement the above mentioned Callbacks as as per their needs.
For issues or questions:
- Check the documentation
- Contact support team