Skip to content

Commit 05b20ac

Browse files
committed
feat: add isLocationEnabled method
1 parent cbea42d commit 05b20ac

File tree

24 files changed

+15413
-64
lines changed

24 files changed

+15413
-64
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,24 @@ npm install react-native-location-status
1212

1313

1414
```js
15-
import { multiply } from 'react-native-location-status';
15+
import { isLocationEnabled } from 'react-native-location-status';
1616

1717
// ...
1818

19-
const result = await multiply(3, 7);
19+
const result = await isLocationEnabled(); // `true` or `false` (Android only)
2020
```
2121

22+
<sub>NOTE: iOS is not supported. Calling `isLocationEnabled()` on iOS will
23+
always return `false`.</sub>
24+
2225

2326
## Contributing
2427

2528
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
2629

2730
## License
2831

29-
MIT
32+
MPL-2.0
3033

3134
---
3235

android/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def supportsNamespace() {
4949

5050
android {
5151
if (supportsNamespace()) {
52-
namespace "com.locationstatus"
52+
namespace "dev.jhale.react.locationstatus"
5353

5454
sourceSets {
5555
main {
@@ -110,6 +110,7 @@ repositories {
110110
def kotlin_version = getExtOrDefault("kotlinVersion")
111111

112112
dependencies {
113+
implementation 'androidx.appcompat:appcompat:1.3.0'
113114
// For < 0.71, this will be from the local maven repo
114115
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
115116
//noinspection GradleDynamicVersion
@@ -121,6 +122,6 @@ if (isNewArchitectureEnabled()) {
121122
react {
122123
jsRootDir = file("../src/")
123124
libraryName = "LocationStatus"
124-
codegenJavaPackageName = "com.locationstatus"
125+
codegenJavaPackageName = "dev.jhale.react.locationstatus"
125126
}
126127
}
42.5 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

android/gradlew

Lines changed: 252 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)