Swiftpack.co - twilio/twilio-voice-ios as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by twilio.
twilio/twilio-voice-ios v3.0.0-preview4
Programmable Voice SDK by Twilio
⭐️ 33
🕓 2 years ago
iOS
.package(url: "https://github.com/twilio/twilio-voice-ios.git", from: "v3.0.0-preview4")

Twilio Programmable Voice for iOS

This repository contains releases for the Twilio Programmable Voice for iOS SDK. These releases can be installed using Swift Package Manager, CocoaPods, Carthage or manually, as you prefer.

Swift Package Manager

You can add Programmable Voice for iOS by adding the https://github.com/twilio/twilio-voice-ios repository as a Swift Package.

In your Build Settings, you will also need to modify Other Linker Flags to include -ObjC.

As of the latest release of Xcode (currently 12.4), there is a known issue with consuming binary frameworks distributed via Swift Package Manager. The current workaround to this issue is to add a Run Script Phase to the Build Phases of your Xcode project. This Run Script Phase should come after the Embed Frameworks build phase. This new Run Script Phase should contain the following code:

find "${CODESIGNING_FOLDER_PATH}" -name '*.framework' -print0 | while read -d $'\0' framework
do
    codesign --force --deep --sign "${EXPANDED_CODE_SIGN_IDENTITY}" --preserve-metadata=identifier,entitlements --timestamp=none "${framework}"
done

CocoaPods

It's easy to install the Voice framework if you manage your dependencies using CocoaPods. Simply add the following to your Podfile:

source 'https://github.com/cocoapods/specs'

target 'TARGET_NAME' do
  use_frameworks!

  pod 'TwilioVoice', '~> 6.2.0'
end

Then run pod install --verbose to install the dependencies to your project.

Carthage

We support integration using Carthage binary frameworks. You can add the Voice iOS SDK by adding the following line to your Cartfile:

binary "https://raw.githubusercontent.com/twilio/twilio-voice-ios/Releases/twilio-voice-ios.json"

Then run carthage bootstrap --use-xcframeworks (or carthage update --use-xcframeworks if you are updating your SDKs)

On your application target's General settings tab, in the Frameworks, Libraries, and Embedded Content section, drag and drop TwilioVoice.xcframework from the Carthage/Build folder on disk.

Manual Integration

See manual installation.

Issues and Support

Please file any issues you find here on Github. Please ensure that you are not sharing any Personally Identifiable Information(PII) or sensitive account information (API keys, credentials, etc.) when reporting an issue.

For general inquiries related to the Voice SDK you can file a support ticket.

License

Twilio Programmable Voice for iOS is distributed under TWILIO-TOS.

GitHub

link
Stars: 33
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Twilio Voice SDK iOS 6.7.0
1 week ago

This release consumes twilio-voice-cpp-4.5.0.

  • Programmable Voice iOS SDK 6.7.0 [XCFramework] (checksum: 97f1d2af07f308327f392fb347ce19e7a0711f1b8c8050b55c33afc78f8fbaef ).

API Updates

  • The SDK now supports sending and receiving user-defined messages via the TVOCallInvite before it is answered or rejected. Sending user-defined messages while call is still ringing (before connected) is also supported now.

Example of sending and receiving call messages via the TVOCallInvite:

// Pass `CallMessageDelegate` in the `handleNotification()` method
TwilioVoiceSDK.handleNotification(payload.dictionaryPayload, delegate: self, delegateQueue: nil, callMessageDelegate: self)

// MARK: - NotificaitonDelegate
func callInviteReceived(callInvite: CallInvite) {
    let message = "{ \"foo\": \"bar\", \"marco\": \"polo\" }"
    let callMessage = CallMessage(content: message)

    // voiceEventSid can be used for tracking the message
    let voiceEventSid = callInvite.sendMessage(callMessage)
}

// MARK: - CallMessageDelegate
func callInviteDidSendMessage(callInvite: CallInvite, voiceEventSid: String) {
    NSLog("Call message sent. Voice Event SID: \(voiceEventSid)")
}

func callInviteDidFailToSendMessage(callInvite: CallInvite, voiceEventSid: String, error: Error) {
    NSLog("Failed to send call message. Voice Event SID: \(voiceEventSid). Error: \(error.localizedDescription)")
}

func callInviteDidReceiveMessage(callInvite: CallInvite, callMessage: CallMessage) {
    NSLog("Call message received: \(callMessage.content)")
}
  • Bitcode support is disabled since App Store no longer accepts bitcode submission from Xcode 14. (Release notes)

Size Impact for 6.7.0

Architecture Compressed Size Uncompressed Size
arm64 3.9 MB 11.4 MB

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics