1.0.3 • Published 5 years ago

react-native-rongim v1.0.3

Weekly downloads
16
License
-
Repository
-
Last release
5 years ago

react-native-rongim

Getting started

$ npm install react-native-rongim --save

Mostly automatic installation

$ react-native link react-native-rongim

###android 补充说明

  • 按照融云官网集成IMKit 的步骤,想android 中引入 融云需要的 依赖的相关module
  • IMLib IMKit CallKit CallLib
  • 即时音视频 需要剔除掉 IMLib 和 CallLib 中libs 目录下 除"armeabi-v7a", "arm64-v8a" 以外的架构.so
 defaultConfig {
    ...
         ndk {
             abiFilters "armeabi-v7a", "arm64-v8a"
         }
     }
  • CallLib 中修改 AndroidManifest.xml 中的相关app key
        <meta-data
            android:name="RONG_CLOUD_APP_KEY"
            android:value="你的key" />

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-rongim and add RNRongim.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNRongim.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.hy.rongim.RNRongimPackage; to the imports at the top of the file
  • Add new RNRongimPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-rongim'
    project(':react-native-rongim').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-rongim/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-rongim')

Usage

import RNRongim from 'react-native-rongim';

// TODO: What to do with the module?
RNRongim;