无法将消息发送到AgoraRTM频道

时间:2020-09-27 08:03:01

标签: swift4.2 agora.io

我正在开发应用程序,当您通过以下Swift4.2代码进入聊天室时,将发送消息“ Hello”。而且,我通过检查Agora-RTM-Tutorial的示例应用程序来检查消息是否已发送。但是,当我进入正在开发的应用程序上的聊天室时,示例应用程序中未显示消息“ Hello”。我确认可以通过示例应用程序发送和接收消息。因此,可以认为开发中的应用程序无法发送消息。没有任何错误消息。你能告诉我这个问题的原因吗?

import UIKit
import AgoraRtmKit

class ChatRoomViewController: UIViewController, AgoraRtmChannelDelegate, AgoraRtmDelegate{
    private var kit: AgoraRtmKit?
    override func viewDidLoad() {
        super.viewDidLoad()
        kit = AgoraRtmKit(appId: "***", delegate: self)
        var session: Void = kit!.login(byToken: nil,user: "testuser");
        var channel: AgoraRtmChannel?
        channel = kit!.createChannel(withId: "testChannel", delegate: self)
        channel!.send(AgoraRtmMessage(text: "Hello"))
    }
}

我保留写出appID并替换为“ ***”。

0 个答案:

没有答案