Hacker News new | ask | show | jobs
by ponyous 2408 days ago
Link me a JavaScript library that works cross platform on both iOS and Android with unified interface in React Native. Ideally it's maintained and if you are asking me why I wrote it, it's also because there was nothing available 2 years ago.

Majority of JS XMPP libraries depend on the DOM for xml parsing - see strophe.js for example. This won't work in all JSC runtimes.

> The point is XMPP is a solved problem

Ye, which problem exactly? All of them are solved partially. Let me give you example, imagine you have a platform where users can chat in chatrooms (as simple as it gets really). On your platform you have a username and you are supposed to communicate with others with your username. You'd think xmpp is perfect! Nope, you'll have to fork the xmpp server for this use case. Why? Well, because XMPP standard supports nickname changing, which means in a context of a platform it would allow nickname spoofing. So you need to modify and add some security rules on top of it. "Solved problem" of course...

3 comments

because XMPP standard supports nickname changing, which means in a context of a platform it would allow nickname spoofing

Nicknames can be registered against a MUC so that other users can't use them. See here: https://xmpp.org/extensions/xep-0045.html#register

This has been part of the MUC standard for years and there are XMPP servers which support this, so you don't need to fork.

If you want to support nickname changing and still know whether it's the same user, you can use the newer XEP-0421: https://xmpp.org/extensions/xep-0421.html

Link me a JavaScript library that works cross platform on both iOS and Android with unified interface in React Native.

https://github.com/xmppjs/xmpp.js

as other have already said, Xmpp.js works quite well

If it's Javascript it's already cross platform

> Ye, which problem exactly?

communicating via XMPP in a standardized way

> All of them are solved partially

And a new protocol based on half backed technologies would change that, how exactly?

> On your platform you have a username and you are supposed to communicate with others with your username.

On any forum or BBS I've been part of in my life, I've always used a nick, that changed over time.

> Well, because XMPP standard supports nickname changing, which means in a context of a platform it would allow nickname spoofing.

That's a feature, not a bug.

In 1995 I could change my nick on IRC, in 1997 I could change my nick on ICQ, I still can change nick on Skype today (my artists friends do it on facebook all the times)

Anyway, nick spoofing on XMPP is hardly a problem and it's not an XMPP fault.

Have you ever tried to search for "someone has been impersonating me with FB messenger" on a search engine?

> "Solved problem" of course.

XMPP it's a solved problem, your chat where nick cannot be changed is your problem.

Every implementation of standard protocols requires work, HTTP is a solved problem, but edge cases still exist.

Name one standard federated protocol that could help you with that and make it simpler, please.

Because I don't know any.