JPush's officially supported React Native plugin (Android & iOS). 极光推送官方支持的 React Native 插件(Android & iOS)。
MIT License
Bot releases are hidden (Show)
Published by huangminlinux over 7 years ago
Separate jpush-react-native into jcore-react-native and jpush-react-native.
After the later version,jpush-react-native and jcore-react-native need to be installed together.
Published by huangminlinux over 7 years ago
delete package dependence.
dependence is not necessary,it will conflict with react-native module
Published by huangminlinux over 7 years ago
Published by KenChoi1992 over 7 years ago
Example:
JPushModule.addReceiveCustomMsgListener((map) => {
this.setState({
pushMsg: map.message
});
console.log("message: " + map.message);
console.log("extras: " + map.extras);
});
Published by KenChoi1992 almost 8 years ago
Server will return registrationId if device registered successfully(after initJPush).
Usage:
componentDidMount() {
JPushModule.addGetRegistrationIdListener((registrationId) => {
console.log("Device register succeed, registrationId " + registrationId);
});
}
componentWillUnmount() {
JPushModule.removeGetRegistrationIdListener("getRegistrationId");
}
Published by huangminlinux almost 8 years ago
Change log:
iOS:
update JPush SDK to 3.0.1
fix bug:
OpenNotification event is dispatched twice
Published by huangminlinux almost 8 years ago
Change log:
在 Appdelegate.m 文件中 jpushNotificationCenter didReceiveNotificationResponse 方法需要做如下修改。
// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
[[NSNotificationCenter defaultCenter] postNotificationName:kJPFOpenNotification object:userInfo];
}
completionHandler(); // 系统要求执行这个方法
}
Published by KenChoi1992 almost 8 years ago
i. use jpush-android-v3.0.0.
ii. Open notification will judge if app is running on background, if running, then open app, else not. See more information if you want to open appointed Activity , please customise here. Reference this article for more detail.
Published by huangminlinux almost 8 years ago
NativeAppEventEmitter.addListener(
'OpenNotification',
(notification) => console.log(notification)
);
4.修改 iOS 自动化配置脚本,添加接口推送的事件代码。
用户只需要关注 js 层的调用即可。
Published by KenChoi1992 almost 8 years ago
Published by huangminlinux almost 8 years ago
修复 系统更新后 demo 运行报错 bug
Published by huangminlinux about 8 years ago
支持 iOS10
Published by KenChoi1992 about 8 years ago
Published by KenChoi1992 about 8 years ago
Published by KenChoi1992 over 8 years ago
Published by huangminlinux over 8 years ago
提供 npm 安装包:jpush-react-native,可通过 npm 命令直接安装与升级本插件。
Published by huangminlinux over 8 years ago
在 React Native 里直接使用原生的 JPush Android/iOS SDK。