mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-18 01:56:11 +08:00
Detect android bundle url
This commit is contained in:
23
lib/index.js
23
lib/index.js
@@ -1,5 +1,9 @@
|
||||
import { tryBackupEndpoints, getCheckUrl, setCustomEndpoints } from './endpoint';
|
||||
import { NativeAppEventEmitter, NativeModules } from 'react-native';
|
||||
import {
|
||||
tryBackupEndpoints,
|
||||
getCheckUrl,
|
||||
setCustomEndpoints,
|
||||
} from './endpoint';
|
||||
import { NativeAppEventEmitter, NativeModules, Platform } from 'react-native';
|
||||
export { setCustomEndpoints };
|
||||
|
||||
let Pushy = NativeModules.Pushy;
|
||||
@@ -15,6 +19,12 @@ export const isFirstTime = Pushy.isFirstTime;
|
||||
export const isRolledBack = Pushy.isRolledBack;
|
||||
export const buildTime = Pushy.buildTime;
|
||||
|
||||
if (Platform.OS === 'android' && !Pushy.isUsingBundleUrl) {
|
||||
throw new Error(
|
||||
'react-native-update模块无法加载,请对照文档检查Bundle URL的配置',
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Return json:
|
||||
Package was expired:
|
||||
@@ -111,11 +121,6 @@ export function markSuccess() {
|
||||
Pushy.markSuccess();
|
||||
}
|
||||
|
||||
// function report(action) {
|
||||
// // ${project}.${host}/logstores/${logstore}/track?APIVersion=0.6.0&key1=val1
|
||||
// fetch(`${logUrl}&action=${action}`);
|
||||
// }
|
||||
NativeAppEventEmitter.addListener('RCTPushyDownloadProgress', (params) => {});
|
||||
|
||||
NativeAppEventEmitter.addListener('RCTPushyDownloadProgress', params => {});
|
||||
|
||||
NativeAppEventEmitter.addListener('RCTPushyUnzipProgress', params => {});
|
||||
NativeAppEventEmitter.addListener('RCTPushyUnzipProgress', (params) => {});
|
||||
|
Reference in New Issue
Block a user