Strophe js in the Titanium Appcelerator?

I want to create a chat application in the Titanium appcelerator using the Strophe.js library. I went through strophe js libraries and their documents. I believe that we can use strophe.js to create an xmpp based application for chatting on the web.

Thanks, please, can someone clarify the following doubts:

  • Is it possible to use strophe js inside our Titanium Appcelerator, if so, suggest me how to use it. I tried to enable the js stanza inside titanium, which shows that I can not find the module error

Here is the code I tried with.

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(); 
  • Can you suggest using any other libraries that you can use inside the Titanium Appceleartor to create a chat application using XMPP
+6
source share
1 answer

It seems that Strophe is created for use inside the browser, and its modification to work inside Titanium is quite risky.

The only XMPP module for Titanium I could find is titanium-xmpp on GitHub .

0
source

Source: https://habr.com/ru/post/969888/


All Articles