react-native-alive-push

Getting started
$ npm install react-native-alive-push --save
alive-push安装好之后默认会进行link,如果link失败请手动link
Mostly automatic installation
$ react-native link react-native-alive-push
Usage
重写ReactNativeHost的getJSBundleFile和getBundleAssetName
Android
@Nullable
@Override
protected String getJSBundleFile() {
return RNAlivePushModule.getJSBundleFile(MainApplication.this);
}
@Nullable
@Override
protected String getBundleAssetName() {
String bundleAssetName = RNAlivePushModule.getBundleAssetName(MainApplication.this);
if (bundleAssetName != null) {
return bundleAssetName;
}
return super.getBundleAssetName();
}
IOS
在AppDelegate.m中添加
#import "RNAlivePush.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
...
NSURL *jsCodeLocation = [RNAlivePush getJSBundleFile];
...
}
Change
0.0.3 ~ 0.0.7
- 更新包的目录结构调整.
APPLICATION_DATA_DIR/INNER_VERSION调整为APPLICATION_DATA_DIR/VERSION_NAME/INNER_VERSION
- 更新了android的package name并修改了android的部分bug
- checkupdate的时候不使用缓存(url添加随机数)
- 添加了debug模式
- 修复了IOS安装的问题
0.0.2
- android/ios alivepush配置文件添加了versionName后缀
- android支持asset-dest bundle
- 修改了下载完成后feedback失败的bug
- 修改了覆盖安装时访问老版本的bug
- 优化了alive-push代码
API
alivePush
Parameters
Returns Function
Returns AlivePushComponent
AlivePushStatus
Properties
AlivePushOption
Type: {deploymentKey: String, host: String?, debug: Boolean?}
Properties