jpush-react-native

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

MIT License

Downloads
830
Stars
1.3K
Committers
37

Bot releases are visible (Hide)

jpush-react-native - Fix Bug

Published by KenChoi1992 about 7 years ago

Change Log

  • fix #309

iOS

jpush-react-native 插件工程 移除 -ljcore-ios 编译选项,jcore 依赖改为 link jcore 工程的形式,如果提示 jcore 类库没有找到,需要更新到 jcore 1.1.8 以上版本。

npm install [email protected]
 react-native link 
jpush-react-native - 新增接口 & Fix Bug

Published by KenChoi1992 about 7 years ago

Change Log

Fix bug

  • fix #261
  • fix #302
  • fix #303
  • fix #304

Android

  • 新增接口 crashLogOFF
  • 新增接口 crashLogON
jpush-react-native - 修复 bug & 适配 RN

Published by KenChoi1992 about 7 years ago

Change Log

  • 适配 RN 0.47.1
  • 修复 #295

Warnings

升级此版本会导致和 RN 0.47 以下版本不兼容。原因在于 RN 0.47 版本去掉了 ReactPackage 中的 createJSModules 接口方法,而不是标注过期。兼容 RN 0.47 以下解决方案:在 JPushPackage 中加入 createJSModules 的实现:

    @Override
    public List<ViewManager> createJSModules(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }
jpush-react-native - Relese 2.0.0

Published by huangminlinux about 7 years ago

升级指南

iOS

  • npm install [email protected] --save
  • 重新 link,2.0.0 新版本开始改变了 iOS 的工程结构所以需要重新 link,如果 unlink 失败重新打开工程 手动删除 自己工程中的 RCTJPushModule 这个子工程
react-native unlink jpush-react-native
react-native link jpush-react-native
  • 在 iOS 工程中 TARGETS-> BUILD SETTINGS -> Search Paths -> Header Search Paths 添加如下路径(由于工程结构变更,需要修改头文件搜索路径)
$(SRCROOT)/../node_modules/jpush-react-native/ios/RCTJPushModule

接口变更

统一部分接口 iOS 、Android

所有 iOS 的事件的监听方式统一改成和 Android 一样的接口调用形式,变动如下(下面接口如没有特别说明,iOS 、Android 通用)

改动前的事件 改动后,通过调用接口的方式来监听该事件
ReceiveNotification JPushModule.addReceiveNotificationListener
networkDidReceiveMessage JPushModule.addReceiveCustomMsgListener
OpenNotification JPushModule.addReceiveOpenNotificationListener
OpenNotificationToLaunchApp(iOS Only) JPushModule.openNotificationLaunchAppEvent (iOS Only)
networkDidSetup、 networkDidClose JPushModule.addConnectionChangeListener
networkDidLogin JPushModule.addnetworkDidLoginListener

新增 API,参数说明详情参考 index.js

Android 和 iOS
  • setTags(tags, cb)
  • addTags(tags, cb)
  • deleteTags(tags, cb)
  • cleanTags(cb)
  • getAllTags(cb)
  • checkTagBindState(tag, cb)
  • setAlias(alias, cb)
  • deleteAlias(cb)
  • getAlias(cb)
  • getConnectionState(cb) Android Only

删除 API

  • setTagsAndAlias()
jpush-react-native - Upgrade Android JPush SDK

Published by KenChoi1992 over 7 years ago

Change Log

  • Android
    Upgrade JPush SDK to v3.0.7, requires jcore-react-native v1.1.5
jpush-react-native - Release 1.7.0 iOS 分离 OpenNotification 事件

Published by huangminlinux over 7 years ago

Change Log:

iOS:

OpenNotification event Separated into OpenNotificationToLaunchApp and OpenNotification

OpenNotificationToLaunchApp event,fire when open notification and launch app。
OpenNotification event,fire when user click notification (available in iOS 10)。

var subscription = NativeAppEventEmitter.addListener(
  'OpenNotificationToLaunchApp',
  (notification) => console.log(notification)
);
jpush-react-native - 修改 API & 调整 demo

Published by KenChoi1992 over 7 years ago

Change Log

Android

  • 调整 clearNotificationById,参数由 string 改为 number
  • 修改 notifyJSDidLoad 为异步接口
  • 新增 jumpToPushActivity,在收到通知后,点击跳转到指定界面。详情请参考 demo 的使用。

fix bug

  • fix #259
  • fix #242
  • fix #258
  • fix #254
jpush-react-native - v1.6.6 增加接口

Published by KenChoi1992 over 7 years ago

更新日志

  • Android
    增加一个新的接口:JPushModule.notifyJSDidLoad();
    使用方法:
    在你想要接收通知类事件之前调用:
componentDidMount() {
		JPushModule.notifyJSDidLoad();
		JPushModule.addReceiveCustomMsgListener((map) => {
			this.setState({
				pushMsg: map.message
			});
			console.log("extras: " + map.extras);
		});
		JPushModule.addReceiveNotificationListener((map) => {
			console.log("alertContent: " + map.alertContent);
			console.log("extras: " + map.extras);
			// var extra = JSON.parse(map.extras);
			// console.log(extra.key + ": " + extra.value);
		});
		JPushModule.addReceiveOpenNotificationListener((map) => {
			console.log("Opening notification!");
			console.log("map.extra: " + map.key);
		});
		JPushModule.addGetRegistrationIdListener((registrationId) => {
			console.log("Device register succeed, registrationId " + registrationId);
		});
	}

Change Log

  • Android
    Add new API: JPushModule.notifyJSDidLoad();
    Usage: before you add listeners call this method first:
componentDidMount() {
		JPushModule.notifyJSDidLoad();
		JPushModule.addReceiveCustomMsgListener((map) => {
			this.setState({
				pushMsg: map.message
			});
			console.log("extras: " + map.extras);
		});
		JPushModule.addReceiveNotificationListener((map) => {
			console.log("alertContent: " + map.alertContent);
			console.log("extras: " + map.extras);
			// var extra = JSON.parse(map.extras);
			// console.log(extra.key + ": " + extra.value);
		});
		JPushModule.addReceiveOpenNotificationListener((map) => {
			console.log("Opening notification!");
			console.log("map.extra: " + map.key);
		});
		JPushModule.addGetRegistrationIdListener((registrationId) => {
			console.log("Device register succeed, registrationId " + registrationId);
		});
	}
jpush-react-native - v1.6.4 Release, Updated JPush SDK

Published by KenChoi1992 over 7 years ago

更新日志

  • Android
    升级 JPush SDK 至 v3.0.6,v1.6.4 版本需要同步升级 jcore-react-native 至 v1.1.3。

Change Log

  • Android
    Updated JPush SDK to v3.0.6, jpush-react-native v1.6.4 requires upgrade jcore-react-native to v1.1.3.
jpush-react-native - v1.6.3 New Feature

Published by KenChoi1992 over 7 years ago

更新日志

用法:

                JPushModule.setAliasAndTags(alias, [], () => {
			console.log("Set alias and tags succeed");
		}, () => {
			console.log("Set alias and tags failed");
		})

Change Log

usage:

                JPushModule.setAliasAndTags(alias, [], () => {
			console.log("Set alias and tags succeed");
		}, () => {
			console.log("Set alias and tags failed");
		})
jpush-react-native - v1.6.2 Fix bug

Published by KenChoi1992 over 7 years ago

更新日志

  • Android
    修复 React instance 尚未完全初始化后调用 JS Module 的 bug

Change Log

  • Android
    Fix bug: calling JS Module while React instance has not fully set up.
jpush-react-native - 1.6.1 修复 bug,更新 demo

Published by KenChoi1992 over 7 years ago

更新日志

更新 README。

  • Android
    更新 Android demo, 点击通知跳转到指定界面详情参考 demo。

Change Log

Updated README.

  • Android
    Upgraded Android demo, how to implement click notification jump to appointed page please refer to demo.
jpush-react-native - v1.6.0 升级 JPush SDK

Published by KenChoi1992 over 7 years ago

改动日志

  • Android & iOS
    更新 JPush SDK 到 v3.0.5。

Change Log

  • Android & iOS
    Updated JPush SDK to v3.0.5.
jpush-react-native - v1.5.6 Release 修复 Bug

Published by KenChoi1992 over 7 years ago

改动日志

Android

  • 修复在 App 不在运行状态下重复收到推送的 bug

Change Log

Android

  • Fix receiving same notification bug while app is not running.
jpush-react-native - Release v1.5.3

Published by huangminlinux over 7 years ago

change log:
fix ios isJPushDidLogin status error bug

更新改动:
修复热更新 isJPushDidLogin 状态错误问题

jpush-react-native - v1.5.4 改进脚本

Published by KenChoi1992 over 7 years ago

Change Log

  • 改进自动配置脚本
jpush-react-native - v1.5.2 Release

Published by KenChoi1992 over 7 years ago

Change Log

  • Android

Receive notifications while app is not running(background or foreground), will save as local notifications.

jpush-react-native - v1.5.1 Release

Published by KenChoi1992 over 7 years ago

Change Log

  • Android

Add try-catch to receiver when receiving ACTION_REGISTRATION_ID , avoid crash while ReactContext is null.

jpush-react-native - v1.5.0 release

Published by huangminlinux over 7 years ago

change log:
added rnpm sharedLibraries in package.json.
After 1.5.0 version, do not have to add sharedLibraries manually

change log:
在 package.json 添加 rnpm sharedLibraries 工程中的必要库,1.5.0 版本之后不需要手动添加这些库了

jpush-react-native - v1.4.6 release

Published by huangminlinux over 7 years ago

fix bug:
fix hot reload Duplicate subscription notification bug.

修复bug:
修复热更新重复订阅的bug。