Skip to content

Commit fc51d16

Browse files
committed
ADD: Mobile Data API
1 parent fe06a2a commit fc51d16

File tree

13 files changed

+46
-8
lines changed

13 files changed

+46
-8
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
@@ -9,6 +9,7 @@ var contact = require("./api/contact");
99
var deeplink = require("./api/deeplink");
1010
var sms = require("./api/sms");
1111
var location = require("./api/location");
12+
var mobiledata = require("./api/mobiledata");
1213
module.exports = {
1314
notification: notification,
1415
hotspot: hotspot,
@@ -21,5 +22,6 @@ module.exports = {
2122
getPath: app.getPath,
2223
loadUrl: app.loadURL,
2324
reload: app.reload,
24-
location: location
25+
location: location,
26+
mobiledata: mobiledata
2527
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use strict";
2+
var NativeModules = require('react-native').NativeModules;
3+
var mobiledata = /** @class */ (function () {
4+
function mobiledata() {
5+
}
6+
mobiledata.prototype.isEnabled = function () {
7+
return NativeModules.Location.isMobileDataEnabled();
8+
};
9+
return mobiledata;
10+
}());
11+
module.exports = new mobiledata();

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "androidjs",
3-
"version": "2.0.2",
3+
"version": "2.0.4",
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": {
@@ -18,5 +18,6 @@
1818
"type": "git",
1919
"url": "https://github.com/android-js/androidjs"
2020
},
21-
"homepage": "https://android-js.github.io"
21+
"homepage": "https://android-js.github.io",
22+
"keywords": ["android", "androidjs", "androidjs-builder", "node", "mobileapp", "mobile", "app", "api", "ipc"]
2223
}

dist/react_native/androidjs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var contact = require("./api/contact");
99
var deeplink = require("./api/deeplink");
1010
var sms = require("./api/sms");
1111
var location = require("./api/location");
12+
var mobiledata = require("./api/mobiledata");
1213
module.exports = {
1314
notification: notification,
1415
hotspot: hotspot,
@@ -21,5 +22,6 @@ module.exports = {
2122
getPath: app.getPath,
2223
loadUrl: app.loadURL,
2324
reload: app.reload,
24-
location: location
25+
location: location,
26+
mobiledata: mobiledata
2527
};

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
@@ -18,6 +18,7 @@ files = [
1818
['./src/react_native/androidjs/api/deeplink.ts', './dist/react_native/api'],
1919
['./src/react_native/androidjs/api/sms.ts', './dist/react_native/api'],
2020
['./src/react_native/androidjs/api/location.ts', './dist/react_native/api'],
21+
['./src/react_native/androidjs/api/mobiledata.ts', './dist/react_native/api'],
2122
['./src/react_native/androidjs/androidjs.ts', './dist/react_native'],
2223
['./src/react_native/androidjs/api/notification.ts', './build/lib/react_native/api'],
2324
['./src/react_native/androidjs/api/app.ts', './build/lib/react_native/api'],
@@ -29,6 +30,7 @@ files = [
2930
['./src/react_native/androidjs/api/deeplink.ts', './build/lib/react_native/api'],
3031
['./src/react_native/androidjs/api/sms.ts', './build/lib/react_native/api'],
3132
['./src/react_native/androidjs/api/location.ts', './build/lib/react_native/api'],
33+
['./src/react_native/androidjs/api/mobiledata.ts', './build/lib/react_native/api'],
3234
['./src/react_native/androidjs/androidjs.ts', './build/lib/react_native']
3335
]
3436

src/react_native/androidjs/androidjs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import contact = require('./api/contact');
88
import deeplink = require('./api/deeplink');
99
import sms = require('./api/sms');
1010
import location = require('./api/location');
11+
import mobiledata = require('./api/mobiledata');
1112

1213
export = {
1314
notification,
@@ -22,4 +23,5 @@ export = {
2223
loadUrl: app.loadURL,
2324
reload: app.reload,
2425
location,
26+
mobiledata,
2527
}

0 commit comments

Comments
 (0)