从接收方应用程序接收消息到发送方应用程序iOS

时间:2017-07-31 10:20:10

标签: ios iphone chromecast

我有一个可以与Chromecast通信的应用。

我的网络接收器应用程序。当我试图从接收端收到消息时,我遇到了问题。

我试图将GCKCastChannel子类化并使用命名空间,我试图在didReceiveTextMessage消息中看到消息,看起来好像没有被调用。

任何人都可以告诉我如何从iOS应用中的接收器接收消息?

我创建了一个名为TextChannel

的类
import Foundation


  class TextChannel : GCKCastChannel {

    override func didReceiveTextMessage(_ message: String) {
    print("Received message: \(message)")
    //Notification
}
}

在我的ViewController中,我有以下代码

 private lazy var textChannel:TextChannel = {
    return TextChannel(namespace: "urn:x-cast:examok.awesome.example")
}()

0 个答案:

没有答案
相关问题