{"id":13764719,"url":"https://github.com/jfield44/SparkSDKWrapper","last_synced_at":"2025-05-10T20:31:03.530Z","repository":{"id":73268594,"uuid":"89103865","full_name":"jfield44/SparkSDKWrapper","owner":"jfield44","description":"Embed Voice and Video calling capabilities into your iOS App in 3 lines of code using the Cisco Spark SDK with this wrapper.","archived":false,"fork":false,"pushed_at":"2017-06-17T14:26:12.000Z","size":184,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-17T01:32:17.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfield44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-04-22T22:52:15.000Z","updated_at":"2022-02-22T06:39:45.000Z","dependencies_parsed_at":"2023-02-26T11:45:21.173Z","dependency_job_id":null,"html_url":"https://github.com/jfield44/SparkSDKWrapper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfield44%2FSparkSDKWrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfield44%2FSparkSDKWrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfield44%2FSparkSDKWrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfield44%2FSparkSDKWrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfield44","download_url":"https://codeload.github.com/jfield44/SparkSDKWrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253480377,"owners_count":21915246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T16:00:27.106Z","updated_at":"2025-05-10T20:31:02.872Z","avatar_url":"https://github.com/jfield44.png","language":"Swift","funding_links":[],"categories":["Code samples"],"sub_categories":["Mobile samples"],"readme":"# Spark SDK Wrapper\n\n## Embed Voice and Video calling capabilities into your iOS App in 3 lines of code using the Cisco Spark SDK with this wrapper.\n\nThe Spark SDK Wrapper is an unofficial convenience library written on top of the Cisco Spark iOS SDK. The purpose of this project is provide a super simple way to add voice and video calling into your app. This wrapper library provides a reference implementation of the SparkSDK as a drop in component that you can add into your existing app to add voice and video capabilities without needing to know how to use the SparkSDK.\n\nThis wrapper handles layout of the video streams for local and remote participants, the call setup process, in call functionality such as muting, and switching the camera as well as hanging up the call.\nWhat that means is that you just need to pass the SparkSDKWrapper your Cisco Spark authentication credentials and the address of the recipient and you will be all set.\n\n\n## Requirements\nIn order to use the Spark SDK Wrapper you need to have an existing iOS project configured to use the Cisco Spark iOS SDK, you can find instructions on how to do that [here](https://github.com/ciscospark/spark-ios-sdk) .\n\nDownload or clone this repository and drag the following files into your Xcode Project:\n * SparkMediaView.swift\n * SparkMediaHelper.swift\n * SparkMediaView.xib\n * SparkMediaSDKAssets.xcassets\n\n*Important:* Apple now require that you provide a justification text to the end user when you request to use the Camera and Microphone on their device. In order to satisfy this requirement you need to provide the justification text. \n\nTo do this, open the info.plist file that resides inside of your Xcode project. Add two new rows, replacing the value with whatever the message is that you wish to display to the end user when they start a call for the first time.\n\n1. Key: `Privacy - Camera Usage Description` Type: `String` Value: `CAMERA_JUSTIFICATION_CHANGE_ME`\n2. Key: `Privacy - Microphone Usage Description` Type: `String` Value: `MICROPHONE_JUSTIFICATION_CHANGE_ME`\n\n*If you fail to do the above step, the app will crash* \n\n\n## Implementation\nThe SparkSDKWrapper uses a UIViewController as a drop in component to display the Video/Voice call.  As a result of this, to use this library you need to ensure that the view from which you will start the call is part of a *UINavigationController*.\n\nPlace the following code wherever at the appropriate point in your project to begin the call. For a better user experience you should consider showing a popup informing the user that they are about to begin a call with an option to cancel.\n\n\n#### Implement the `SparkMediaViewDelegate` Protocol in your ViewController, this is how you will be notified when a call has completed or an error occurred.\n\n```swift\nimport UIKit\n\nclass ViewController: UIViewController, SparkMediaViewDelegate {\n // YOUR IMPLEMENTATION\n}\n```\n\n\n#### Implement the two mandatory delegate functions `callDidComplete()` and `callFailed(withError: String)`\n\n```swift\nimport UIKit\n\nclass ViewController: UIViewController, SparkMediaViewDelegate {\n\n    // YOUR IMPLEMENTATION\n\n    func callDidComplete() {\n        // Add your handling logic here\n    }\n    \n    func callFailed(withError: String) {\n        // Add your handling logic here\n    }\n\n}\n```\n\n\n#### To start a Video Call:\n```swift\nimport UIKit\n\nclass ViewController: UIViewController, SparkMediaViewDelegate {\n\n  // YOUR IMPLEMENTATION\n\n  func startCall() {\n  \t// Who are you?\n  \tlet sparkMedia = SparkMediaView(authType: .sparkId ,apiKey: \"API_KEY\", delegate: self) \n\t// Who do you want to call? Is it Voice or Video?\n\tsparkMedia.videoCall(recipient: \"RECIPIENT_ADDRESS\")     \n\t// Where should I display the call view?\n\tself.present(sparkMedia, animated: true, completion: nil) \n    }\n\n  func callDidComplete() {\n        // Add your handling logic here\n    }\n    \n  func callFailed(withError: String) {\n        // Add your handling logic here\n    }\n}\n```\n\n\n#### To start a Voice Call:\n```swift\nimport UIKit\n\nclass ViewController: UIViewController, SparkMediaViewDelegate {\n \n  // YOUR IMPLEMENTATION\n\n  func startCall() {\n  \t// Who are you?\n  \tlet sparkMedia = SparkMediaView(authType: .sparkId ,apiKey: \"API_KEY\", delegate: self) \n\t// Who do you want to call? Is it Voice or Video?\n\tsparkMedia.voiceCall(recipient: \"RECIPIENT_ADDRESS\")     \n\t// Where should I display the call view?\n\tself.present(sparkMedia, animated: true, completion: nil) \n    }\n\n  func callDidComplete() {\n        // Add your handling logic here\n    }\n    \n  func callFailed(withError: String) {\n        // Add your handling logic here\n    }\n}\n```\n\n\nThats it… you are all set to start making awesome video and voice calls using the Cisco Spark SDK.\n\n\nIts likely that you will want to customise the way that the calling experience looks to suit your app or business. You can do this using the SparkMediaView.swift file for the implementation and the SparkMediaView.xib for the GUI.\n\n\n\n## License\nSparkSDKWrapper is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfield44%2FSparkSDKWrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfield44%2FSparkSDKWrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfield44%2FSparkSDKWrapper/lists"}