Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CodePush.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 0 additions & 5 deletions CodePush.m
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,6 @@ - (void)savePendingUpdate:(NSString *)packageHash
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);
Expand Down Expand Up @@ -549,7 +545,6 @@ - (void)savePendingUpdate:(NSString *)packageHash

resolve(nil);
});
#endif
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,6 @@ protected Void doInBackground(Object... params) {

@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
Expand Down
3 changes: 2 additions & 1 deletion package-mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -20,6 +20,6 @@
"semver": "^5.1.0"
},
"devDependencies": {
"react-native": "0.15.0"
"react-native": "0.19.0"
}
}