diff --git a/CodePush.js b/CodePush.js index b95296a..79821f9 100644 --- a/CodePush.js +++ b/CodePush.js @@ -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(); diff --git a/CodePush.m b/CodePush.m index a7aa7b3..e97298d 100644 --- a/CodePush.m +++ b/CodePush.m @@ -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 } /* diff --git a/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java b/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java index f84102c..a247724 100644 --- a/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +++ b/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java @@ -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 diff --git a/package-mixins.js b/package-mixins.js index 6078bee..fb68ead 100644 --- a/package-mixins.js +++ b/package-mixins.js @@ -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(); diff --git a/package.json b/package.json index d626df2..7c1f696 100644 --- a/package.json +++ b/package.json @@ -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" } }