npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-im-easemob

v1.1.5

Published

Easemob for React Native.

Downloads

90

Readme

react-native-im-easemob

npm version Build Status

环信IM的原生接口React-Native封装库。

安装

使用Yarn安装:

yarn add react-native-im-easemob

使用npm安装:

npm install --save react-native-im-easemob

iOS环境设置

添加Podfile,类似如下格式:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

def common_target
    pod 'MJExtension', :git => 'https://github.com/RNCommon/MJExtension.git', :commit => 'cd3de71c4955935a762a46e59d90160991f5fa92'
    // React target and other common target...
end

target "MainTarget" do
    common_target
    pod 'Hyphenate', '= 3.6.2'
    pod 'react-native-im-easemob/Dev', :path => '../node_modules/react-native-im-easemob'
end

target "DeployTarget" do
    common_target
    pod 'HySDKDeploy', '= 3.6.2'
    pod 'react-native-im-easemob/Deploy', :path => '../node_modules/react-native-im-easemob'
end

其中MainTarget是真机和模拟器通用的部署Target,主要用于调试。DeployTarget是只支持armv7和arm64的Target,主要用于打包发布。

这是因为环信SDK的原因,Hyphenate打包需要使用lipo来处理Hyphenate.framework,从中剔除i386和x86_64的模拟器框架。具体原因请参照环信文档。

Android环境设置

在settings.gradle文件中添加:

include ':react-native-im-easemob'
project(':react-native-im-easemob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-im-easemob/android')

在module级的build.gradle中添加:

dependencies {
    implementation project(':react-native-im-easemob')
}

在ReactNativeHost中添加:

import com.im.easemob.EasemobPackage;

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new EasemobPackage()
    );
}

Android离线推送接收消息,需要配置appId和appKey或者appId和AappSecret (不同的手机需要配置的不一样,具体参考环信文档:http://docs-im.easemob.com/im/android/push/thirdpartypush) 在主工程中的AndroidManifest.xml中配置appId和appKey或者appId和AappSecret

 <!-- start  离线推送配置appId和appSecret(小米,oppo,meizu)-->
        <meta-data
            android:name="IM_EASEMOB_XIAOMI_PUSH_APP_ID"
            android:value="替换成你自己申请的小米APP_ID" />
        <meta-data
            android:name="IM_EASEMOB_XIAOMI_PUSH_APP_KEY"
            android:value="替换成你自己申请的小米APP_KEY" />

        <meta-data
            android:name="IM_EASEMOB_OPPO_PUSH_APP_KEY"
            android:value="替换成你自己申请的OPPO的APP_KEY" />
        <meta-data
            android:name="IM_EASEMOB_OPPO_PUSH_APP_SECRET"
            android:value="替换成你自己申请的OPPO的APP_SECRET" />

        <meta-data
            android:name="IM_EASEMOB_MEIZU_PUSH_APP_ID"
            android:value="替换成你自己申请的魅族的APP_ID" />
        <meta-data
            android:name="IM_EASEMOB_MEIZU_PUSH_APP_KEY"
            android:value="替换成你自己申请的魅族的APP_KEY" />
        <!--end      离线推送配置appId和appSecret(小米,oppo,meizu)-->