Pra*_*bhu 6 xmpp ejabberd titanium strophe titanium-mobile
我想使用Strophe.js库在Titanium appcelerator中创建一个聊天应用程序.我也经历过strshe js库及其文档.我相信我们可以使用strophe.js在web中构建基于xmpp的聊天应用程序.
在此先感谢,任何人都可以澄清以下疑惑,
这是我试过的代码.
Ti.include("includes/strophe.js");
Ti.include("includes/strophe.register.js");
connection.register.connect("localhost:5280", callback, wait, hold);
var callback = function (status) {
if (status === Strophe.Status.REGISTER) {
connection.register.fields.username = "newuser";
connection.register.fields.password = "123456";
connection.register.submit();
} else if (status === Strophe.Status.REGISTERED) {
console.log("registered!");
connection.authenticate();
} else if (status === Strophe.Status.CONNECTED) {
console.log("logged in!");
} else {
// every other status a connection.connect would receive
}
};
$.index.open();
Run Code Online (Sandbox Code Playgroud)
看起来 Strope 是为了在浏览器中使用而创建的,修改它以在 Titanium 中工作是相当危险的。
我能找到的 Titanium 的唯一 XMPP 模块是GitHub 上的 titan-xmpp。
| 归档时间: |
|
| 查看次数: |
432 次 |
| 最近记录: |