5
votes

I need to integrate with xmpp server from react native application.I've found an existing library for react native iOS version (https://github.com/aksonov/react-native-xmpp) .

But I could not find any existing react native xmpp library for Android version.

Could someone please let me know if any library is available and point me towards it?

Is it possible to write a native android library for xmpp and then link it my React native code?

3

3 Answers

2
votes

You can use a library like Smack on Android and expose it to react-native yourself. If you have some experience with Java it is usually not that difficult: native modules docs.

Without knowing too much about the libraries, I think the challenge would be to unify the api for iOS and Android. If you only want to support Android that would not be a problem. Otherwise ask the author of react-native-xmpp to integrate your Android code.

0
votes
  • react-native-xmpp An XMPP library for React Native. Both iOS and Android are supported.

  • I prefer xmpp.js. It supports Node.js, browser and React Native. It is a cross-platform lib because it is written by Javascript. You can use the fowllwing command to add lib depdendency:

    npm install @xmpp/client

  • StropheAnother XMPP library for JavaScript.

0
votes

Here is a complete guide on how to use xmpp.js lib for ReactNative and how to connect to XMPP server and send a message: https://medium.com/@connectycube/xmpp-real-time-chat-in-react-native-8d6d5d23dd47

I guess this is the only one lib which is up to date and which supports well all the ReactNative environment