【发布时间】:2016-11-25 13:22:37
【问题描述】:
我正在为我的聊天应用程序使用 xmpp 框架 iOS 库,遇到一些关于用户最后活动的问题,它给出了“禁止”错误
这是我获取用户最后活动的代码
let senderJID = XMPPJID.init(string:detailVC.bareJidStr)
let lastAcivity = appDelegate.lastActivity?.sendQuery(to: senderJID, withTimeout: XMPPStreamTimeoutNone)
print(lastAcivity as Any)
public func xmppLastActivity(_ sender: XMPPLastActivity!, didReceiveResponse response: XMPPIQ!) {
// Extract the seconds from response IQ
let time = response.lastActivitySeconds()
print("time in seconds \(time)")
print("response \(response))")}
error:-> <error code="403" type="auth"><forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></forbidden></error>
【问题讨论】:
-
需要传入Authentication参数。
-
谢谢,但是如何传递参数呢?可以举个例子吗
-
@Bucket 你有解决办法吗?
-
@Bucket 你找到解决办法了吗?
标签: ios swift xmpp xmppframework