Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit b1babeb

Browse files
committed
disable-metrics-in-debug
1 parent 6e887fa commit b1babeb

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

CodePush.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ function log(message) {
137137

138138
async function notifyApplicationReady() {
139139
await NativeCodePush.notifyApplicationReady();
140+
if (__DEV__) {
141+
// Don't report metrics if in DEV mode.
142+
return;
143+
}
144+
140145
const statusReport = await NativeCodePush.getNewStatusReport();
141146
if (statusReport) {
142147
const config = await getConfiguration();

CodePush.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ - (void)savePendingUpdate:(NSString *)packageHash
512512
RCT_EXPORT_METHOD(getNewStatusReport:(RCTPromiseResolveBlock)resolve
513513
rejecter:(RCTPromiseRejectBlock)reject)
514514
{
515+
if ([_bridge.bundleURL.scheme hasPrefix:@"http"]) {
516+
resolve(nil);
517+
return;
518+
}
515519

516520
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
517521
if (needToReportRollback) {
@@ -532,7 +536,7 @@ - (void)savePendingUpdate:(NSString *)packageHash
532536
resolve([CodePushTelemetryManager getUpdateReport:currentPackage]);
533537
return;
534538
}
535-
} else if (isRunningBinaryVersion || [_bridge.bundleURL.scheme hasPrefix:@"http"]) {
539+
} else if (isRunningBinaryVersion) {
536540
// Check if the current appVersion has been reported.
537541
NSString *appVersion = [[CodePushConfig current] appVersion];
538542
resolve([CodePushTelemetryManager getBinaryUpdateReport:appVersion]);

android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ android {
2222
}
2323

2424
dependencies {
25-
compile fileTree(dir: 'libs', include: ['*.jar'])
26-
compile 'com.android.support:appcompat-v7:23.0.0'
27-
compile 'com.facebook.react:react-native:0.15.1'
25+
compile fileTree(dir: "libs", include: ["*.jar"])
26+
compile "com.android.support:appcompat-v7:23.0.1"
27+
compile "com.facebook.react:react-native:0.19.+"
2828
}

package-mixins.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ module.exports = (NativeCodePush) => {
2525
// so that the client knows what the current package version is.
2626
try {
2727
const downloadedPackage = await NativeCodePush.downloadUpdate(this);
28-
reportStatusDownload && reportStatusDownload(this);
28+
// Don't report metrics if in DEV mode.
29+
!__DEV__ && reportStatusDownload && reportStatusDownload(this);
2930
return { ...downloadedPackage, ...local };
3031
} finally {
3132
downloadProgressSubscription && downloadProgressSubscription.remove();

0 commit comments

Comments
 (0)