How to use the @react-native-community/cli/build/commands/link/android/patches/revokePatch.default function in @react-native-community/cli

To help you get started, we’ve selected a few @react-native-community/cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mauron85 / react-native-background-geolocation / scripts / postunlink.js View on Github external
const path = require('path');
const config = require('./config');
const isInstalled = require('./isInstalled');

if (isInstalled.forAndroid()) {
  const revokePatch = require('@react-native-community/cli/build/commands/link/android/patches/revokePatch').default;
  const makeSettingsPatch = require('@react-native-community/cli/build/commands/link/android/patches/makeSettingsPatch').default;
  revokePatch(
    config.settingsGradlePath,
    makeSettingsPatch(
      config.commonModuleName,
      { sourceDir: path.join(config.moduleDir, 'android', config.commonModuleDir) },
      config
    )
  );
}


if (isInstalled.forIos()) {
  // we should remove background modes and usage descriptions here
  // It will destroy all project customizations, so we rather leave it as is.
}