{"_id":"@dominicvonk/react-native-disable-battery-optimizations-android","_rev":"2-b6eaf09bbabcf77dcd689f822664bf08","name":"@dominicvonk/react-native-disable-battery-optimizations-android","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.0":{"name":"@dominicvonk/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.60.0-rc.0 <1.0.x"},"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":"dc036c49e521b493fd57183e7d7fa42aaadb3134","_id":"@dominicvonk/react-native-disable-battery-optimizations-android@1.1.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-sgwx+utCLxXJr2Qxf7oqWY1mHeREe7kvVSwtpeQweSmZsyLvh2MRpWLdyF+AHW6d3cyRY/RN7quhJyTjL5/ORw==","shasum":"b13ca3eda46279bdbe8ab44279415389d091668b","tarball":"https://registry.npmjs.org/@dominicvonk/react-native-disable-battery-optimizations-android/-/react-native-disable-battery-optimizations-android-1.1.0.tgz","fileCount":20,"unpackedSize":36378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8nDgCRA9TVsSAnZWagAA/rUP/2XfrIMCFeDwI8R1+LqF\nsN+e3O9F4IjjiDd/v6Nl2ie5TsAuIrdXUpysJRkfBIHDcZ8eSafEeDdlO8rO\noy9vCwvCQr9Zt0rj4cl9rPcx8++oenfYj9P2EXETf1NtM4rtvT0KzKdnJXSa\nIBZH3JM7eGFvBwz9QaxXEyqS8NONT3dXA/Bvk2XXOFBkYVrr6gprF0UNxEws\nIvIK74YD7yXyhF9m+LVzMR8QbNlTv4bBZwc0AbkKs3+x3sOAbT24zjgQTpmg\nzHN5fXlji0lCa+npojx1ktWDJ3KeBqcSaJISQRB0QSBT4nHH2gxSrajnplb+\n3/mAzp44sna4iIMAyUoAXDqwrwigrM6CyD9e9IAXjtnIEaYid8TCz9ConNzl\nZRBHTMkQAp561ChTyG+P3QBB9lDV3P4/QCbmW+rOipmZGjIccw7tSYfvp/Tx\nh8C9I6xtvbQrT+o414ek7GxbBbHLCHZwhCkoFIoPrivMeIB8Psk6MThkHkJ8\nGq3pcbvzNbvtbwF5bROklEjlEjjlwhfFc1QKA3psG2gt+JjTLg1NEcsDfGpx\nHnDj9ZjefBOp1w2SHHuEKBAbg+6EhlKGjyMh6JCsh5XSHcMHnD1rSZMD4FZX\nuEUsQM2QnUNAdnSDAVLIVILTF6VsVOIgQjySYo/E9PoUmb/sykgOQwMUm0K4\nsH2l\r\n=dlCR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmQjJyE1UfBhUrPsejLMuhPPfRU5JaC1+9q2GpnSDWdAiBnNzbY13WTbbaeBIYVFZzF/bmEbFYUQxGm9PSO+mxa/w=="}]},"_npmUser":{"name":"dominicvonk","email":"dominic@dominicvonk.com"},"directories":{},"maintainers":[{"name":"dominicvonk","email":"dominic@dominicvonk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-disable-battery-optimizations-android_1.1.0_1643278560410_0.9260065654108007"},"_hasShrinkwrap":false},"1.1.1":{"name":"@dominicvonk/react-native-disable-battery-optimizations-android","version":"1.1.1","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/dominicvonk/react-native-disable-battery-optimizations-android.git"},"author":{"name":"@brandonhenao"},"license":"MIT","peerDependencies":{"react-native":"*"},"bugs":{"url":"https://github.com/dominicvonk/react-native-disable-battery-optimizations-android/issues"},"homepage":"https://github.com/dominicvonk/react-native-disable-battery-optimizations-android#readme","gitHead":"dc036c49e521b493fd57183e7d7fa42aaadb3134","_id":"@dominicvonk/react-native-disable-battery-optimizations-android@1.1.1","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-uBI3VRQ4duJ19y3mlX3xRoItjpnMCo8LdK6WMFyHAWP3POg8ngNY1yjX82TYXboBKnMQLWt9A2YDH8y9LdIghw==","shasum":"fdf53f03f4ff9523607adb61d8604279568e7380","tarball":"https://registry.npmjs.org/@dominicvonk/react-native-disable-battery-optimizations-android/-/react-native-disable-battery-optimizations-android-1.1.1.tgz","fileCount":20,"unpackedSize":36679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKF80ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoFA/+PnCvNxSHSWsJfYdC/Dt5AV7/bQ4dLaUXHT1f2jnfdsY+/Rfv\r\n67jpgEnZXA/seUSZzxA7M/EHuyNY7ZOQtaOIM3R1c4Ist5uHyz/5yLTTjORK\r\nQjzKzVwSM0mKiwDOAfjY0SkWvjb/VJwrYJAuz2q9ORL5d7npavav9c9RAL6s\r\nct4nr1eDpyLS9W/bPqmxEuGcI/ZMbuNWQmACONUwya15XwaO3DuxETDC11GQ\r\njkAtRiR4N6HVhVI1XFlSQvscYXmnR/EZRPc4gXXJPavFnoj/40X+DstflCBX\r\ngsh58rBiU5PfatVsb0+IOAN9/7Ct+TFUq8WguyjpbluiKXfGLYXmyeB1fHgS\r\nKeyAlWScZ0l2/Lz1ZIRbxknn7c7LVZUW2WMEr0XZrP0z/oVdMN75comxRNKC\r\ne82Fkzo90ONeOodno2ykOHmvdBG/BsOXhOuUTg5yaDaoEyPBR0q7qiDJ0Gqy\r\nDA9drM1O6azhKb9aaZZNxMDBwtMltV6i4Qvy/Yw5pQAumWGMTTJeL6+zl5m5\r\nZGz/ox7KpYU3IJu7yXW9rS9S/wV/QUA6mlv9e1CewDB7+GOfpxV2/70bOb//\r\nyCRjMlcPeWnheTL0C4IDx1D4gRtL8pLvIDSATrIRV8VrpEdPs7X5vF+Oempb\r\nihhioEyXPXMLM4zkL60verjmKRWhFPeuIW0=\r\n=v5rB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVdZPn+X7PIWFxPwDdDdLHiOy67W0Ik9OKs0xnVBJErAiBv++Xr5Be4FoLu8pB4HUvXfQcgQva8aLXJAW6P+likCQ=="}]},"_npmUser":{"name":"dominicvonk","email":"dominic@dominicvonk.com"},"directories":{},"maintainers":[{"name":"dominicvonk","email":"dominic@dominicvonk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-disable-battery-optimizations-android_1.1.1_1646812980501_0.3626864983962763"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-27T10:16:00.337Z","1.1.0":"2022-01-27T10:16:00.533Z","modified":"2022-04-05T05:14:07.603Z","1.1.1":"2022-03-09T08:03:00.646Z"},"maintainers":[{"name":"dominicvonk","email":"dominic@dominicvonk.com"}],"description":"A react native library for checking battery optimization and whitelisting in Android","homepage":"https://github.com/dominicvonk/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/dominicvonk/react-native-disable-battery-optimizations-android.git"},"author":{"name":"@brandonhenao"},"bugs":{"url":"https://github.com/dominicvonk/react-native-disable-battery-optimizations-android/issues"},"license":"MIT","readme":"# react-native-disable-battery-optimizations-android\n\nThe act of requesting **REQUEST_IGNORE_BATTERY_OPTIMIZATIONS** in the manifest\nis what may get you\n[banned](https://commonsware.com/blog/2015/11/11/google-anti-trust-issues.html),\nso it was remove.\n\n# 🔥🔥 Upgraded and merged some fixes from other forked repos 🔥🔥\n\nthis is a fork of\nhttps://github.com/IronTony/react-native-disable-battery-optimizations-android.\n\n## Getting started\n\n`$ npm i @dominicvonk/react-native-disable-battery-optimizations-android --save`\n\n### Mostly automatic installation for react native >= v 0.60\n\nManual linking not required for above versions\n\nFor manual linking :\n`$ react-native link @dominicvonk/react-native-disable-battery-optimizations-android`\n\n### Manual installation\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n\n- Add `import com.reactlibrary.RNDisableBatteryOptimizationsandroidPackage;` to\n  the imports at the top of the file\n- Add `new RNDisableBatteryOptimizationsPackage()` to the list returned by the\n  `getPackages()` method\n\n2. Append the following lines to `android/settings.gradle`:\n   ```\n   include ':@dominicvonk/react-native-disable-battery-optimizations-android'\n   project(':@dominicvonk/react-native-disable-battery-optimizations-android').projectDir = new File(rootProject.projectDir, \t'../node_modules/@dominicvonk/react-native-disable-battery-optimizations-android/android')\n   ```\n3. Insert the following lines inside the dependencies block in\n   `android/app/build.gradle`:\n   ```\n   compile project(':@dominicvonk/react-native-disable-battery-optimizations-android')\n   ```\n\n## Usage\n\n```javascript\nimport RNDisableBatteryOptimizationsAndroid from \"@dominicvonk/react-native-disable-battery-optimizations-android\";\n\nRNDisableBatteryOptimizationsAndroid.isBatteryOptimizationEnabled().then(\n  (isEnabled) => {\n    if (isEnabled) {\n      RNDisableBatteryOptimizationsAndroid.openBatteryModal();\n    }\n  },\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\nRNDisableBatteryOptimizationsAndroid.enableBackgroundServicesDialogue();\n```\n","readmeFilename":"README.md"}