最近調(diào)試xmpp,用于視頻的甩屏功能,出現(xiàn)了xmpp能夠連上服務(wù)器,但是無法登陸認(rèn)證的問題
就是
表示xmpp服務(wù)器鏈接成功
- (void)xmppStreamDidConnect:(XMPPStream *)sender ;
但是會走
xmpp登錄失敗
- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(NSXMLElement *)error;
查看error信息是:
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized></not-authorized></failure>
網(wǎng)上搜索此類錯誤信息都是 domain設(shè)置問題.
但是跟服務(wù)器那邊測試是沒有問題的,安卓是能夠調(diào)通的.
后來抓取日志看到
設(shè)置xmppjid的時候使用的賬號明明是小寫,但是在服務(wù)器那邊接收到的是大寫
打斷點(diǎn)看到
XMPPJID這個類里有個
將賬號轉(zhuǎn)換成大寫的方法
- (NSString *)user
{
return [user uppercaseString]; // Why didn't we just synthesize this? See comment above.
}
將此方法修改直接返回user后 問題解決!!!
原來以前安卓也遇到過此類問題.. - -!
為什么會將賬號大寫呢?
未完待續(xù)...