SamsungSmart TV Ios Sender


I’ve been trying to create a sender app for IOS for a few days now, but to know avail. The documentation is unfortunately incomplete. The example for listeners uses technology obsoleted in Swift 3, it does not explain the need to extend from ServiceSearchDelegate, it makes reference to a non-existent variable, “serviceDiscovery”, “onServiceFound” is never called though I have my device and my tv on the same network, and the list goes on and on. Would it be possible to have someone publish a working IOS sender example with the latest updates?

Furthermore, the documentation ( has not been updated since 2017 though there was a release Nov 2019.

Here’s an idea of something I got working, for anyone coming along!

import SmartView

class SamsungSmartview: ServiceSearchDelegate {

  private var services: [Service] = []
  private var serviceSearch =

  override init() {
    serviceSearch.delegate = self

  @objc func startSearch() -> Void {

  @objc func stopSearch() -> Void {

  // MARK: - ServiceSearchDelegate -
  // Update your UI by using the array
  @objc func onServiceFound(_ service: Service) {
    if (!services.contains(where: { $ == })) {

  @objc func onServiceLost(_ service: Service) {
    services.removeAll(where: { $ == })

  @objc func cast(_ options: NSDictionary) -> Void {
    let id = options.value(forKey: "id") as! String
    let service = getServiceById(id:id)
    let videoPlayer = service?.createVideoPlayer("SmartView")
    let url = options.value(forKey: "url") as! String
    let title = options.value(forKey: "title") as! String
    let imageUrl = options.value(forKey: "image_url") as! String
        URL(string: url),
        title: title,
        thumbnailURL: URL(string: imageUrl),
        completionHandler: {
            (error:NSError?) -> Void in
            // resolve 

  @objc func getServiceById(id: String) -> Service? {
    return services.first(where: { $ == id })