This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
src/main/java/com/microsoft/codepush/react Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,15 @@ - (void)savePendingUpdate:(NSString *)packageHash
512512RCT_EXPORT_METHOD (getNewStatusReport:(RCTPromiseResolveBlock)resolve
513513 rejecter:(RCTPromiseRejectBlock)reject)
514514{
515+ #ifdef DEBUG
516+ // Do not report metrics if running in debug mode.
517+ resolve (nil );
518+ #else
519+ if ([_bridge.bundleURL.scheme hasPrefix: @" http" ]) {
520+ // Do not report metrics if running bundle from packager.
521+ resolve (nil );
522+ return ;
523+ }
515524
516525 dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
517526 if (needToReportRollback) {
@@ -532,15 +541,15 @@ - (void)savePendingUpdate:(NSString *)packageHash
532541 resolve ([CodePushTelemetryManager getUpdateReport: currentPackage]);
533542 return ;
534543 }
535- } else if (isRunningBinaryVersion || [_bridge.bundleURL.scheme hasPrefix: @" http" ]) {
536- // Check if the current appVersion has been reported.
544+ } else if (isRunningBinaryVersion) {
537545 NSString *appVersion = [[CodePushConfig current ] appVersion ];
538546 resolve ([CodePushTelemetryManager getBinaryUpdateReport: appVersion]);
539547 return ;
540548 }
541549
542550 resolve (nil );
543551 });
552+ #endif
544553}
545554
546555/*
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ android {
2222}
2323
2424dependencies {
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}
Original file line number Diff line number Diff line change @@ -426,6 +426,11 @@ protected Void doInBackground(Object... params) {
426426
427427 @ ReactMethod
428428 public void getNewStatusReport (final Promise promise ) {
429+ if (isDebugMode ) {
430+ // Do not report metrics if running in debug mode.
431+ promise .resolve ("" );
432+ return ;
433+ }
429434
430435 AsyncTask asyncTask = new AsyncTask () {
431436 @ Override
You can’t perform that action at this time.
0 commit comments