File tree 3 files changed +19
-5
lines changed
src/main/java/com/microsoft/codepush/react
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
512
512
RCT_EXPORT_METHOD (getNewStatusReport:(RCTPromiseResolveBlock)resolve
513
513
rejecter:(RCTPromiseRejectBlock)reject)
514
514
{
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
+ }
515
524
516
525
dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
517
526
if (needToReportRollback) {
@@ -532,15 +541,15 @@ - (void)savePendingUpdate:(NSString *)packageHash
532
541
resolve ([CodePushTelemetryManager getUpdateReport: currentPackage]);
533
542
return ;
534
543
}
535
- } else if (isRunningBinaryVersion || [_bridge.bundleURL.scheme hasPrefix: @" http" ]) {
536
- // Check if the current appVersion has been reported.
544
+ } else if (isRunningBinaryVersion) {
537
545
NSString *appVersion = [[CodePushConfig current ] appVersion ];
538
546
resolve ([CodePushTelemetryManager getBinaryUpdateReport: appVersion]);
539
547
return ;
540
548
}
541
549
542
550
resolve (nil );
543
551
});
552
+ #endif
544
553
}
545
554
546
555
/*
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ android {
22
22
}
23
23
24
24
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.+ "
28
28
}
Original file line number Diff line number Diff line change @@ -426,6 +426,11 @@ protected Void doInBackground(Object... params) {
426
426
427
427
@ ReactMethod
428
428
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
+ }
429
434
430
435
AsyncTask asyncTask = new AsyncTask () {
431
436
@ Override
You can’t perform that action at this time.
0 commit comments