An XMPP library for React Native. Android platform are tested.
view demo on repository: https://github.com/john-shine/react-native-xmpp-demo/
yarn add react-native-xmpp
Please use CocoaPods
-
Install latest XMPPFramework: https://github.com/robbiehanson/XMPPFramework
pod 'XMPPFramework', :git => 'https://github.com/robbiehanson/XMPPFramework.git', :branch => 'master'
-
Add this package pod:
pod 'RNXMPP', :path => '../node_modules/react-native-xmpp'
If you have problems with latest 4.0 XMPPFramework and/or XCode 9.3, you may use old one with forked KissXML:
pod 'XMPPFramework', '~> 3.7.0'
pod 'KissXML', :git => "https://github.com/aksonov/KissXML.git", :branch => '5.1.4'
react-native link react-native-xmpp
If it doesn't link the react-native-xmpp correct:
android/settings.gradle
include ':react-native-xmpp'
project(':react-native-xmpp').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-xmpp/android')
android/app/build.gradle
dependencies {
...
compile project(':react-native-xmpp')
}
MainApplication.java
On top, where imports are:
import com.rnxmpp.RNXMPPPackage;
Add the ReactVideoPackage
class to your list of exported packages.
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNXMPPPackage()
);
}