Merge pull request #176 from Microsoft/disable-metrics-in-debug

Disable metrics in debug
This commit is contained in:
Geoffrey Goh
2016-02-02 16:33:27 -08:00
5 changed files with 9 additions and 13 deletions

View File

@@ -137,6 +137,11 @@ function log(message) {
async function notifyApplicationReady() {
await NativeCodePush.notifyApplicationReady();
if (__DEV__) {
// Don't report metrics if in DEV mode.
return;
}
const statusReport = await NativeCodePush.getNewStatusReport();
if (statusReport) {
const config = await getConfiguration();

View File

@@ -512,10 +512,6 @@ RCT_EXPORT_METHOD(notifyApplicationReady:(RCTPromiseResolveBlock)resolve
RCT_EXPORT_METHOD(getNewStatusReport:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
#ifdef DEBUG
// Do not report metrics if running in debug mode.
resolve(nil);
#else
if ([_bridge.bundleURL.scheme hasPrefix:@"http"]) {
// Do not report metrics if running bundle from packager.
resolve(nil);
@@ -549,7 +545,6 @@ RCT_EXPORT_METHOD(getNewStatusReport:(RCTPromiseResolveBlock)resolve
resolve(nil);
});
#endif
}
/*

View File

@@ -426,11 +426,6 @@ public class CodePush {
@ReactMethod
public void getNewStatusReport(final Promise promise) {
if (isDebugMode) {
// Do not report metrics if running in debug mode.
promise.resolve("");
return;
}
AsyncTask asyncTask = new AsyncTask() {
@Override

View File

@@ -25,7 +25,8 @@ module.exports = (NativeCodePush) => {
// so that the client knows what the current package version is.
try {
const downloadedPackage = await NativeCodePush.downloadUpdate(this);
reportStatusDownload && reportStatusDownload(this);
// Don't report metrics if in DEV mode.
!__DEV__ && reportStatusDownload && reportStatusDownload(this);
return { ...downloadedPackage, ...local };
} finally {
downloadProgressSubscription && downloadProgressSubscription.remove();

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-code-push",
"version": "1.6.0-beta",
"version": "1.7.0-beta",
"description": "React Native plugin for the CodePush service",
"main": "CodePush.js",
"homepage": "https://microsoft.github.io/code-push",
@@ -20,6 +20,6 @@
"semver": "^5.1.0"
},
"devDependencies": {
"react-native": "0.15.0"
"react-native": "0.19.0"
}
}