{"_id":"@brandonhenao/react-native-disable-battery-optimizations-android","_rev":"1-f67d7cb49546e737a8371a0b23754403","name":"@brandonhenao/react-native-disable-battery-optimizations-android","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@brandonhenao/react-native-disable-battery-optimizations-android","version":"1.1.0","description":"A react native library for checking battery optimization and whitelisting in Android","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["react-native","settings","android","open","battery-optimizations","background service"],"repository":{"type":"git","url":"git+https://github.com/ingbrandon/react-native-disable-battery-optimizations-android.git"},"author":{"name":"@brandonhenao"},"license":"MIT","peerDependencies":{"react-native":"^0.41.2"},"bugs":{"url":"https://github.com/ingbrandon/react-native-disable-battery-optimizations-android/issues"},"homepage":"https://github.com/ingbrandon/react-native-disable-battery-optimizations-android#readme","gitHead":"5c1e1382a0c0d5b022d0a4e16960dee968e316c6","_id":"@brandonhenao/react-native-disable-battery-optimizations-android@1.1.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-3DKjBySxHBJq9My7I8uYkdwzGYD2er/L7fwI/hJ6YqzsBL4L1CV/DDy16uW6WVCHCNQA8YDhRyxxAnUKuY1sXw==","shasum":"43970f4030c9421e518e9f738ef465864a43830d","tarball":"https://registry.npmjs.org/@brandonhenao/react-native-disable-battery-optimizations-android/-/react-native-disable-battery-optimizations-android-1.1.0.tgz","fileCount":20,"unpackedSize":36345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9NzeCRA9TVsSAnZWagAA8GgQAIqsjeaUTdUtME4k5NMy\nvIVWDmWdA3iTnbBCchCOyMldctC3XVxn7mxjOQ9cuTXLD6inwL29TUdYA5eB\ngDTLSS8+DN2NG+41xDXh5RZySIT0FZtV4RBulqtqaiA7ZaxAsmn0Cgb+jWmc\nAIsFb4eiGILP9B8bRLhSPURev4+oU2csHrknMG5bnTgQMt4iW80ezcds6q3V\nLG2kLKg/FvlEdEwaqEO8NN1izzr9DLoKi6GsVVJkm8FqB09GGqSNdjyBrrsk\nQ9nl+lONjDpFgkEkYV0eYcq/eu6Vg8dLt1GRYDJ4gB7v26dWGr0LUcFS7Lec\nwjFj7mZBV2ZYDPM/RNjmc6K29BXJlsjDPy4MvJKgJWSEOAQPoIiLj+sp0H3N\nM9xgyhrBaPPmCkwWNI4eQGQIG7aJxvx2H0ru82WR70G6nKIm3KwSR9cDrh0/\nLJdSTfWILOzniGwWuWEKvZOwcWqHfC405jDdTHqQ0DmaZ+aAPLP3nZEEKXjU\nLh+Ko5zwLfVL4+v8TUxKsMRwM2c3BZbLIOcjjWH0UIfSVjuhx+T7VyQqNjKf\nBz63drX6BbhPam4AVVJvjTiEqoQb/q3EoLkrImGn9nfxeR9wxnQ/S1S3jYkW\nHX0fwlPWIO1u+XXUXB9RdJrRU7DHnsaxpPmhaT5gwqHh8f/4Q2fZsbgg4G3v\nH7bv\r\n=Nd4Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHoEoaPiaJWkKYbHCfexwUWmpS6hU7raQydWD/bubA7hAiEAjVAALRRjzxmlldaRJZylNeIAO0jJE4N1porHlpzT0gk="}]},"_npmUser":{"name":"brandonhenao","email":"jbhenao17@misena.edu.co"},"directories":{},"maintainers":[{"name":"brandonhenao","email":"jbhenao17@misena.edu.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-disable-battery-optimizations-android_1.1.0_1609882846163_0.21560745214545118"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-05T21:40:46.099Z","1.1.0":"2021-01-05T21:40:46.324Z","modified":"2022-04-04T20:25:16.054Z"},"maintainers":[{"name":"brandonhenao","email":"jbhenao17@misena.edu.co"}],"description":"A react native library for checking battery optimization and whitelisting in Android","homepage":"https://github.com/ingbrandon/react-native-disable-battery-optimizations-android#readme","keywords":["react-native","settings","android","open","battery-optimizations","background service"],"repository":{"type":"git","url":"git+https://github.com/ingbrandon/react-native-disable-battery-optimizations-android.git"},"author":{"name":"@brandonhenao"},"bugs":{"url":"https://github.com/ingbrandon/react-native-disable-battery-optimizations-android/issues"},"license":"MIT","readme":"# react-native-disable-battery-optimizations-android\nThe act of requesting **REQUEST_IGNORE_BATTERY_OPTIMIZATIONS** in the manifest is what may get you [banned](https://commonsware.com/blog/2015/11/11/google-anti-trust-issues.html), so it was remove.\n\n\n# 🔥🔥 Upgraded and merged some fixes from other forked repos 🔥🔥\nthis is a fork of https://github.com/IronTony/react-native-disable-battery-optimizations-android.\n\n## Getting started\n`$ npm i @brandonhenao/react-native-disable-battery-optimizations-android`\n\n### Mostly automatic installation for react native >= v 0.60\nManual linking not required for above versions\n\nFor manual linking :\n`$ react-native link @brandonhenao/react-native-disable-battery-optimizations-android`\n\n### Manual installation\n\n\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.reactlibrary.RNDisableBatteryOptimizationsandroidPackage;` to the imports at the top of the file\n  - Add `new RNDisableBatteryOptimizationsPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':@brandonhenao/react-native-disable-battery-optimizations-android'\n  \tproject(':@brandonhenao/react-native-disable-battery-optimizations-android').projectDir = new File(rootProject.projectDir, \t'../node_modules/@brandonhenao/react-native-disable-battery-optimizations-android/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':@brandonhenao/react-native-disable-battery-optimizations-android')\n  \t```\n\n## Usage\n```javascript\nimport RNDisableBatteryOptimizationsAndroid from '@brandonhenao/react-native-disable-battery-optimizations-android';\n\nRNDisableBatteryOptimizationsAndroid.isBatteryOptimizationEnabled().then((isEnabled)=>{\n\tif(isEnabled){\n\t\tRNDisableBatteryOptimizationsAndroid.openBatteryModal();\n\t}\n});\n\n// for direct whitelisting app with Instant Dialogue \n// The user will be taken to a screen where they can indicate that they are willing to suspend portions of Doze mode effects on your app.\n// Note: Play store will not allow using this method, and will allow only as an exception\n\n\nRNDisableBatteryOptimizationsAndroid.enableBackgroundServicesDialogue();  \n```","readmeFilename":"README.md"}