Skip to content

Commit 9e635ca

Browse files
committed
#added some change
1 parent 5acd3d6 commit 9e635ca

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

android/lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ android {
8282
}
8383

8484
dependencies {
85-
implementation project(path: ':@hariks789_react-native-background-geolocation-common')
85+
implementation project(path: ':@mak12_react-native-background-geolocation-common')
8686

8787
projDependencies.each {
8888
add(it.configuration, it.dependency)

android/lib/src/main/java/com/marianhello/bgloc/react/BackgroundGeolocationModule.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class BackgroundGeolocationModule extends ReactContextBaseJavaModule impl
4747

4848
private BackgroundGeolocationFacade facade;
4949
private org.slf4j.Logger logger;
50+
private ReactApplicationContext currentContext;
5051

5152
public static class ErrorMap {
5253
public static ReadableMap from(String message, int code) {
@@ -85,6 +86,7 @@ private static WritableMap from(Throwable e) {
8586
public BackgroundGeolocationModule(ReactApplicationContext reactContext) {
8687
super(reactContext);
8788
reactContext.addLifecycleEventListener(this);
89+
currentContext = reactContext;
8890

8991
facade = new BackgroundGeolocationFacade(getContext(), this);
9092
logger = LoggerManager.getLogger(BackgroundGeolocationModule.class);
@@ -323,7 +325,7 @@ public void forceSync(Callback success, Callback error) {
323325
}
324326

325327
private void sendEvent(String eventName, Object params) {
326-
getReactApplicationContext()
328+
currentContext
327329
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
328330
.emit(eventName, params);
329331
}
@@ -349,7 +351,8 @@ public int getAuthorizationStatus() {
349351
}
350352

351353
public Context getContext() {
352-
return getReactApplicationContext().getBaseContext();
354+
// return getReactApplicationContext().getBaseContext();
355+
return currentContext;
353356
}
354357

355358
@Override

android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include ':lib'
2-
include ':@hariks789_react-native-background-geolocation-common'
3-
project(':@hariks789_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, './common')
2+
include ':@mak12_react-native-background-geolocation-common'
3+
project(':@mak12_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, './common')

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "@hariks789/react-native-background-geolocation",
2+
"name": "@mak12/react-native-background-geolocation",
33
"version": "0.7.0",
44
"description": "Optimized background location tracking",
55
"main": "./index.js",
66
"types": "./index.d.ts",
77
"scripts": {
8-
"link": "@hariks789/react-native-background-geolocation/scripts/postlink.js",
9-
"unlink": "@hariks789/react-native-background-geolocation/scripts/postunlink.js",
8+
"link": "@mak12/react-native-background-geolocation/scripts/postlink.js",
9+
"unlink": "@mak12/react-native-background-geolocation/scripts/postunlink.js",
1010
"test": "echo \"Error: no test specified\" && exit 1"
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "git+https://github.com/hariks789/react-native-background-geolocation.git"
14+
"url": "git+https://github.com/mak12/react-native-background-geolocation.git"
1515
},
1616
"keywords": [
1717
"gps",
@@ -39,11 +39,11 @@
3939
],
4040
"license": "Apache-2.0",
4141
"bugs": {
42-
"url": "https://github.com/hariks789/react-native-background-geolocation/issues"
42+
"url": "https://github.com/mak12/react-native-background-geolocation/issues"
4343
},
44-
"homepage": "https://github.com/hariks789/react-native-background-geolocation#readme",
44+
"homepage": "https://github.com/mak12/react-native-background-geolocation#readme",
4545
"dependencies": {
46-
"@hariks789/react-native-background-geolocation": "^0.6.9",
46+
"@mak12/react-native-background-geolocation": "^0.6.9",
4747
"plist": "^3.0.1"
4848
},
4949
"peerDependencies": {

react-native.config.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
module.exports = {
2-
dependency: {
3-
platforms: {
4-
android: {
5-
sourceDir: "./android/lib"
6-
}
7-
},
8-
hooks: {
9-
postlink: "node ./node_modules/@hariks789/react-native-background-geolocation/scripts/postlink.js",
10-
postunlink: "node ./node_modules/@hariks789/react-native-background-geolocation/scripts/postunlink.js"
11-
}
12-
}
2+
dependency: {
3+
platforms: {
4+
android: {
5+
sourceDir: "./android/lib",
6+
},
7+
},
8+
hooks: {
9+
postlink:
10+
"node ./node_modules/@mak12/react-native-background-geolocation/scripts/postlink.js",
11+
postunlink:
12+
"node ./node_modules/@mak12/react-native-background-geolocation/scripts/postunlink.js",
13+
},
14+
},
1315
};

0 commit comments

Comments
 (0)