Skip to content

Commit fe06a2a

Browse files
committed
Add: Location API
1 parent 115cb9e commit fe06a2a

File tree

13 files changed

+52
-10
lines changed

13 files changed

+52
-10
lines changed

build/lib/androidjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/react_native/androidjs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var call = require("./api/call");
88
var contact = require("./api/contact");
99
var deeplink = require("./api/deeplink");
1010
var sms = require("./api/sms");
11+
var location = require("./api/location");
1112
module.exports = {
1213
notification: notification,
1314
hotspot: hotspot,
@@ -19,5 +20,6 @@ module.exports = {
1920
sms: sms,
2021
getPath: app.getPath,
2122
loadUrl: app.loadURL,
22-
reload: app.reload
23+
reload: app.reload,
24+
location: location
2325
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use strict";
2+
var NativeModules = require('react-native').NativeModules;
3+
//@ts-ignore
4+
var location = /** @class */ (function () {
5+
function location() {
6+
}
7+
location.prototype.get = function () {
8+
return JSON.parse(NativeModules.Location.getLocation());
9+
};
10+
return location;
11+
}());
12+
module.exports = new location();

build/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "androidjs",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Android JS Is A Framework For Creating Android Applications With Web Technologies Like JavaScript, HTML, And CSS.",
55
"main": "index.js",
66
"scripts": {
@@ -15,8 +15,8 @@
1515
"socket.io-client": "^2.2.0"
1616
},
1717
"repository": {
18-
"type" : "git",
19-
"url" : "https://github.com/android-js/androidjs"
18+
"type": "git",
19+
"url": "https://github.com/android-js/androidjs"
2020
},
2121
"homepage": "https://android-js.github.io"
2222
}

dist/react_native/androidjs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var call = require("./api/call");
88
var contact = require("./api/contact");
99
var deeplink = require("./api/deeplink");
1010
var sms = require("./api/sms");
11+
var location = require("./api/location");
1112
module.exports = {
1213
notification: notification,
1314
hotspot: hotspot,
@@ -19,5 +20,6 @@ module.exports = {
1920
sms: sms,
2021
getPath: app.getPath,
2122
loadUrl: app.loadURL,
22-
reload: app.reload
23+
reload: app.reload,
24+
location: location
2325
};

dist/webview/androidjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webview/androidjs/androidjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/build.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ files = [
1717
['./src/react_native/androidjs/api/contact.ts', './dist/react_native/api'],
1818
['./src/react_native/androidjs/api/deeplink.ts', './dist/react_native/api'],
1919
['./src/react_native/androidjs/api/sms.ts', './dist/react_native/api'],
20+
['./src/react_native/androidjs/api/location.ts', './dist/react_native/api'],
2021
['./src/react_native/androidjs/androidjs.ts', './dist/react_native'],
2122
['./src/react_native/androidjs/api/notification.ts', './build/lib/react_native/api'],
2223
['./src/react_native/androidjs/api/app.ts', './build/lib/react_native/api'],
@@ -27,6 +28,7 @@ files = [
2728
['./src/react_native/androidjs/api/contact.ts', './build/lib/react_native/api'],
2829
['./src/react_native/androidjs/api/deeplink.ts', './build/lib/react_native/api'],
2930
['./src/react_native/androidjs/api/sms.ts', './build/lib/react_native/api'],
31+
['./src/react_native/androidjs/api/location.ts', './build/lib/react_native/api'],
3032
['./src/react_native/androidjs/androidjs.ts', './build/lib/react_native']
3133
]
3234

src/react_native/androidjs/androidjs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import call = require('./api/call');
77
import contact = require('./api/contact');
88
import deeplink = require('./api/deeplink');
99
import sms = require('./api/sms');
10+
import location = require('./api/location');
1011

1112
export = {
1213
notification,
@@ -19,5 +20,6 @@ export = {
1920
sms,
2021
getPath: app.getPath,
2122
loadUrl: app.loadURL,
22-
reload: app.reload
23+
reload: app.reload,
24+
location,
2325
}

0 commit comments

Comments
 (0)