• Stars
    star
    1,351
  • Rank 34,773 (Top 0.7 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JPush's officially supported React Native plugin (Android & iOS). 极光推送官方支持的 React Native 插件(Android & iOS)。

JPush-React-Native

ChangeLog

  1. 从RN-JPush2.7.5开始,重新支持TypeScript
  2. 由于RN-JCore1.6.0存在编译问题,从RN-JCore1.7.0开始,还是需要在AndroidManifest.xml中添加配置代码,具体参考 配置-2.1 Android

1. 安装

npm install jpush-react-native --save
  • 注意:如果项目里没有jcore-react-native,需要安装

    npm install jcore-react-native --save
    

安装完成后连接原生库 进入到根目录执行
react-native link

react-native link jpush-react-native
react-native link jcore-react-native

2. 配置

2.1 Android

  • build.gradle

    android {
          defaultConfig {
              applicationId "yourApplicationId"           //在此替换你的应用包名
              ...
              manifestPlaceholders = [
                      JPUSH_APPKEY: "yourAppKey",         //在此替换你的APPKey
                      JPUSH_CHANNEL: "yourChannel"        //在此替换你的channel
              ]
          }
      }
    
    dependencies {
          ...
          implementation project(':jpush-react-native')  // 添加 jpush 依赖
          implementation project(':jcore-react-native')  // 添加 jcore 依赖
      }
    
  • setting.gradle

    include ':jpush-react-native'
    project(':jpush-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jpush-react-native/android')
    include ':jcore-react-native'
    project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android')
    
  • AndroidManifest.xml

    <meta-data
    	android:name="JPUSH_CHANNEL"
    	android:value="${JPUSH_CHANNEL}" />
    <meta-data
    	android:name="JPUSH_APPKEY"
    	android:value="${JPUSH_APPKEY}" />    
    

2.2 iOS

注意:您需要打开ios目录下的.xcworkspace文件修改您的包名

2.2.1 pod

pod install
  • 注意:如果项目里使用pod安装过,请先执行命令

    pod deintegrate
    

2.2.2 手动方式

  • Libraries

    Add Files to "your project name"
    node_modules/jcore-react-native/ios/RCTJCoreModule.xcodeproj
    node_modules/jpush-react-native/ios/RCTJPushModule.xcodeproj
    
  • Capabilities

    Push Notification --- ON
    
  • Build Settings

    All --- Search Paths --- Header Search Paths --- +
    $(SRCROOT)/../node_modules/jcore-react-native/ios/RCTJCoreModule/
    $(SRCROOT)/../node_modules/jpush-react-native/ios/RCTJPushModule/
    
  • Build Phases

    libz.tbd
    libresolv.tbd
    UserNotifications.framework
    libRCTJCoreModule.a
    libRCTJPushModule.a
    

3. 引用

3.1 Android

参考:MainApplication.java

3.2 iOS

参考:AppDelegate.m

3.3 js

参考:App.js

4. API

详见:index.js

5. 其他

  • 集成前务必将example工程跑通
  • 如有紧急需求请前往极光社区
  • 上报问题还麻烦先调用JPush.setLoggerEnable(true},拿到debug日志

More Repositories

1

aurora-imui

General IM UI components. Android/iOS/RectNative ready. 通用 IM 聊天 UI 组件,已经同时支持 Android/iOS/RN。
Java
5,710
star
2

jpush-phonegap-plugin

JPush's officially supported PhoneGap/Cordova plugin (Android & iOS). 极光推送官方支持的 PhoneGap/Cordova 插件(Android & iOS)。
JavaScript
926
star
3

jpush-flutter-plugin

JPush's officially supported Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)。
Objective-C
825
star
4

jpush-api-java-client

JiGuang's officially supported Java client library for accessing JPush APIs. 极光官方支持的 Java 版本服务器端 SDK。
Java
724
star
5

jpush-api-php-client

JPush's officially supported PHP client library for accessing JPush APIs. 极光推送官方支持的 PHP 版本服务器端 SDK。
PHP
524
star
6

jchat-android

JChat android app. A real app based on JMessage SDK.
Java
376
star
7

jchat-swift

Swift version of JChat iOS.
Swift
290
star
8

jpush-api-nodejs-client

JPush's officially supported Node.js client library for accessing JPush APIs. 极光推送官方支持的 Node.js 版本服务器端 SDK。
JavaScript
240
star
9

jpush-api-python-client

JPush's officially supported Python client library for accessing JPush APIs. 极光推送官方支持的 Python 版本服务器端 SDK。
Python
208
star
10

jmessage-react-plugin

Objective-C
184
star
11

jmessage-flutter-plugin

JMessage's Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)。
Java
166
star
12

jpush-hbuilder-demo

极光推送官方提供的 HBuilder 示例代码,可用于快速集成 JPush SDK 到 HBuilder 项目里。
JavaScript
144
star
13

jpush-api-csharp-client

JPush's officially supported C# client library for accessing JPush APIs. 极光推送官方支持的 C# 版本服务器端 SDK。
C#
135
star
14

jverify-flutter-plugin

JPush's officially supported Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)。
Objective-C
117
star
15

jpush-unity3d-plugin

JPush's officially supported Unity3d plugin (Android & iOS). 极光推送官方支持的 Unity3d 插件(Android & iOS)。
C#
114
star
16

jpush-docs

JPush docs on official website. 极光推送官方文档。
HTML
114
star
17

jmessage-phonegap-plugin

JiGuang's officially supported JMessage PhoneGap/Cordova plugin (Android & iOS). 极光官方支持的 IM PhoneGap/Cordova 插件。
JavaScript
106
star
18

jchat-web

JChat web
TypeScript
105
star
19

jshare-react-native

Objective-C
104
star
20

jchat-ios

JChat iOS app, a real app based on JMessage SDK.
Objective-C
102
star
21

jpush-api-ruby-client

JPush's officially supported Ruby client library for accessing JPush APIs. 极光推送官方支持的 Ruby 版本服务器端 SDK。
Ruby
99
star
22

jbox

极光宝盒,一个基于 JPush 的轻便易用的通知框架。
Python
74
star
23

aurora-imui-examples

Swift
65
star
24

jmessage-api-java-client

JiGuang's officially supported Java client library for accessing JMessage APIs. 极光官方支持的 Java 版本服务器端 SDK。
Java
60
star
25

jpush-swift-demo

Offically supported Swift Demo for JPush iOS SDK.
Swift
55
star
26

janalytics-react-native

Objective-C
52
star
27

jcore-react-native

Objective-C
49
star
28

jpush-hbuilder-plugin

Vue
48
star
29

jmessage-api-php-client

JMessage's officially supported PHP client library for accessing JMessage APIs. 极光IM官方支持的 PHP 版本服务器端 SDK。
PHP
43
star
30

jmessage-android-uikit

极光IM Android SDK UI 组件
Java
39
star
31

janalytics-flutter-plugin

Dart
38
star
32

jmessage-ios-uikit

极光IM iOS SDK UI 组件
Objective-C
31
star
33

jverification-react-native

Objective-C
30
star
34

jpush-java-library

Java library for JPush API. Moved to - https://github.com/jpush/jpush-api-java-client 本库不再维护,做了迁移。
Java
30
star
35

jpush-ios-sdk-pod

JPush's officially supported iOS SDK Pod for CocosPods. 极光推送官方支持的 iOS SDK Pod.
Objective-C
28
star
36

jsms-api-java-client

JiGuang's officially supported Java client library for accessing JSMS APIs. 极光官方支持的 JSMS Java 版本服务器端 SDK。
Java
27
star
37

jverification-hbuilder-plugin

极光认证官方支持的 hbuilder 插件(Android & iOS)
Objective-C
24
star
38

jshare-flutter-plugin

JShare's officially supported Flutter plugin (Android & iOS). 极光分享官方支持的 Flutter 插件(Android & iOS)。
Dart
24
star
39

cordova-plugin-jcore

Java
20
star
40

jmlink-flutter-plugin

JPush's officially supported Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)。
Dart
19
star
41

jiguang-java-client-common

Common lib for JiGuang Java clients.
Java
18
star
42

jpush-cocos2d-x-plugin

JPush's officially supported Cocos2d-x plugin (Android & iOS). 极光推送官方支持的 Cocos2d-x 插件(Android & iOS)。
Python
18
star
43

jpush-android-samples

JPush's officially supported Android SDK samples for demo SDK APIs. 极光推送官方支持的 Android SDK 示例,以演示如何使用 SDK APIs。
Java
18
star
44

cordova-plugin-janalytics

Objective-C
14
star
45

JVerfication-Demo

Objective-C
14
star
46

android-push-example

更丰富地演示基于 JPush Android SDK 可以实现的功能、效果。
Java
14
star
47

jchat-windows

JChat Windows Application
C++
13
star
48

jmessage-api-csharp-client

JMessage's officially supported CSharp client library for accessing JMessage APIs. 极光IM官方支持的 CSharp 版本服务器端 SDK。
C#
13
star
49

jmrtc-react-native

Objective-C
10
star
50

jmessage-api-python-client

JiGuang's officially supported Python client library for accessing JMessage APIs. 极光官方支持的 JMessage Python 版本服务器端 SDK。
Python
9
star
51

jpush-weex-plugin

Java
8
star
52

jsms-api-php-client

JiGuang's officially supported PHP client library for accessing JSMS APIs. 极光官方支持的 JSMS PHP 版本服务器端 SDK。
PHP
8
star
53

cordova-plugin-jsms

JiGuang's officially supported JSMS PhoneGap/Cordova plugin (Android & iOS). 极光官方支持的短信验证码 PhoneGap/Cordova 插件。
Objective-C
8
star
54

JIoT-SDK-C

C
7
star
55

jmlink_demo

jmlink demo
Java
7
star
56

jpush-api-go-client

JPush's officially supported Go-lang client library for accessing JPush APIs. 极光推送官方支持的 Go 语言版本服务器端 SDK。
5
star
57

jpush-opensource

JPush official website for open-source projects.
CSS
5
star
58

JVerification-cordova-plugin

极光认证官方支持的 cordova 插件(Android & iOS)
Objective-C
4
star
59

jmrtc-phonegap-plugin

Objective-C
4
star
60

cordova-plugin-jshare

极光官方支持的社交分享 Cordova 插件。
3
star
61

jsms-react-native

Java
3
star
62

jmessage-ios-pod

JMessage iOS SDK (framework) for CocoaPods
Objective-C
3
star
63

jpush-ios-samples

JPush's officially supported iOS SDK samples for demo SDK APIs. 极光推送官方支持的 iOS SDK 示例,以演示如何使用 SDK APIs。
Objective-C
3
star
64

jsms-api-csharp-client

JiGuang's officially supported C# client library for accessing JSMS APIs. 极光官方支持的 JSMS C# 版本服务器端 SDK。
C#
3
star
65

ios-resources-review

2
star
66

jmlink-react-native

JMlink's officially supported react native plugin (Android & iOS). 极光魔链官方支持的 react native 插件(Android & iOS)。
Objective-C
2
star
67

JIoT-rtthread-package

JIoT SDK rt-thread package
C
2
star
68

jmessage-android-samples

极光IM Android SDK 样例
2
star
69

joperate-flutter-plugin

Dart
2
star
70

JIoT-SDK-Android

极光 IoT 客户端 SDK Android
Java
1
star
71

jmessage-unity3d-plugin

1
star
72

jcore-hbuilder-plugin

Objective-C
1
star
73

janalytics-hbuilder-demo

HTML
1
star
74

jsms-api-python-client

Python
1
star
75

Jpush-Google

1
star