Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const rnpmlink = require('appcenter-link-scripts');
// Configure Android first.
let promise = null;
if (rnpmlink.android.checkIfAndroidDirectoryExists()) {
console.log('Configuring AppCenter Data for Android');
promise = rnpmlink.android.initAppCenterConfig()
.then(() => {
rnpmlink.android.removeAndroidDuplicateLinks();
}).catch((e) => {
console.error(`Could not configure AppCenter Data for Android. Error Reason - ${e.message}`);
return Promise.resolve();
});
} else {
promise = Promise.resolve();
}
// Then iOS even if Android failed.
if (rnpmlink.ios.checkIfAppDelegateExists()) {
promise
.then(() => {
console.log('Configuring AppCenter Data for iOS');
return rnpmlink.ios.initAppCenterConfig();
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const rnpmlink = require('appcenter-link-scripts');
// Configure Android first.
let promise = null;
if (rnpmlink.android.checkIfAndroidDirectoryExists()) {
console.log('Configuring AppCenter Auth for Android');
promise = rnpmlink.android.initAppCenterConfig()
.then(() => {
rnpmlink.android.removeAndroidDuplicateLinks();
}).catch((e) => {
console.error(`Could not configure AppCenter Auth for Android. Error Reason - ${e.message}`);
return Promise.resolve();
});
} else {
promise = Promise.resolve();
}
// Then iOS even if Android failed.
if (rnpmlink.ios.checkIfAppDelegateExists()) {
promise
.then(() => {
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const rnpmlink = require('appcenter-link-scripts');
// Configure Android first.
let promise = null;
if (rnpmlink.android.checkIfAndroidDirectoryExists()) {
console.log('Configuring AppCenter Analytics for Android');
promise = rnpmlink.android.initAppCenterConfig()
.then(() => {
rnpmlink.android.removeAndroidDuplicateLinks();
}).catch((e) => {
console.error(`Could not configure AppCenter for Android. Error Reason - ${e.message}`);
return Promise.resolve();
});
} else {
promise = Promise.resolve();
}
// Then iOS even if Android failed.
if (rnpmlink.ios.checkIfAppDelegateExists()) {
promise
.then(() => {
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const rnpmlink = require('appcenter-link-scripts');
console.log('Please enter your Android and iOS app secrets below.');
console.log('For more information: https://docs.microsoft.com/en-us/appcenter/sdk/getting-started/react-native');
// Configure Android first.
let promise = null;
if (rnpmlink.android.checkIfAndroidDirectoryExists()) {
console.log('Configuring AppCenter Analytics for Android');
promise = rnpmlink.android.initAppCenterConfig()
.then(() => {
rnpmlink.android.removeAndroidDuplicateLinks();
}).catch((e) => {
console.error(`Could not configure AppCenter Push for Android. Error Reason - ${e.message}`);
return Promise.resolve();
});
} else {
promise = Promise.resolve();
}
// Then iOS even if Android failed.
if (rnpmlink.ios.checkIfAppDelegateExists()) {
promise
.then(() => {
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const rnpmlink = require('appcenter-link-scripts');
// Configure Android first.
let promise;
if (rnpmlink.android.checkIfAndroidDirectoryExists()) {
console.log('Configuring AppCenter Crashes for Android');
promise = rnpmlink.android.initAppCenterConfig()
.then(() => {
rnpmlink.android.patchStrings('appCenterCrashes_whenToSendCrashes',
'ALWAYS_SEND');
rnpmlink.android.removeAndroidDuplicateLinks();
}).catch((e) => {
console.error(`Could not configure AppCenter Crashes for Android. Error Reason - ${e.message}`);
return Promise.resolve();
});
} else {
promise = Promise.resolve();
}
// Then iOS even if Android failed.
if (rnpmlink.ios.checkIfAppDelegateExists()) {
const rnpmlink = require('appcenter-link-scripts');
console.log('Configuring AppCenter Analytics');
return rnpmlink.android.checkIfAndroidDirectoryExists()
.then(() => {
rnpmlink.android.initConfig()
.catch((e) => {
console.log(`Could not create AppCenter config file. Error Reason - ${e.message}`);
return Promise.reject();
});
})
.catch(() => Promise.resolve());
const rnpmlink = require('appcenter-link-scripts');
console.log('Configuring AppCenter Crashes');
return rnpmlink.android.checkIfAndroidDirectoryExists()
.then(() => {
rnpmlink.android.initAppCenterConfig()
.catch((e) => {
console.log(`Could not create AppCenter config file. Error Reason - ${e.message}`);
return Promise.reject();
});
})
.catch(() => Promise.resolve());
.then(() => {
rnpmlink.android.initAppCenterConfig()
.catch((e) => {
console.log(`Could not create AppCenter config file. Error Reason - ${e.message}`);
return Promise.reject();
});
})
.catch(() => Promise.resolve());
const rnpmlink = require('appcenter-link-scripts');
console.log('Configuring AppCenter Push');
return rnpmlink.android.checkIfAndroidDirectoryExists()
.then(() => {
rnpmlink.android.initAppCenterConfig()
.catch((e) => {
console.log(`Could not create AppCenter config file. Error Reason - ${e.message}`);
return Promise.reject();
});
})
.catch(() => Promise.resolve());
.then(() => {
rnpmlink.android.patchStrings('appCenterAnalytics_whenToEnableAnalytics', 'ALWAYS_SEND');
rnpmlink.android.removeAndroidDuplicateLinks();
}).catch((e) => {
console.error(`Could not configure AppCenter Analytics for Android. Error Reason - ${e.message}`);