mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-03-15 12:51:00 +08:00
Added amazon-fireos platform.
Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'
This commit is contained in:
parent
ac65585efc
commit
bfe7ab777e
17
plugin.xml
17
plugin.xml
@ -49,6 +49,23 @@ xmlns:android="http://schemas.android.com/apk/res/android"
|
|||||||
|
|
||||||
</platform>
|
</platform>
|
||||||
|
|
||||||
|
<!-- amazon-fireos -->
|
||||||
|
<platform name="amazon-fireos">
|
||||||
|
<config-file target="res/xml/config.xml" parent="/*">
|
||||||
|
<feature name="NetworkStatus">
|
||||||
|
<param name="android-package" value="org.apache.cordova.networkinformation.NetworkManager"/>
|
||||||
|
</feature>
|
||||||
|
</config-file>
|
||||||
|
|
||||||
|
<config-file target="AndroidManifest.xml" parent="/*">
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
</config-file>
|
||||||
|
|
||||||
|
<source-file src="src/android/NetworkManager.java" target-dir="src/org/apache/cordova/networkinformation" />
|
||||||
|
|
||||||
|
</platform>
|
||||||
|
|
||||||
|
|
||||||
<!-- ios -->
|
<!-- ios -->
|
||||||
<platform name="ios">
|
<platform name="ios">
|
||||||
<config-file target="config.xml" parent="/*">
|
<config-file target="config.xml" parent="/*">
|
||||||
|
6
test/cordova-incl.js
vendored
6
test/cordova-incl.js
vendored
@ -20,7 +20,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var PLAT;
|
var PLAT;
|
||||||
if (/Android/.exec(navigator.userAgent)) {
|
if (/cordova-amazon-fireos/.exec(navigator.userAgent)) {
|
||||||
|
PLAT = 'amazon-fireos';
|
||||||
|
}else if (/Android/.exec(navigator.userAgent)) {
|
||||||
PLAT = 'android';
|
PLAT = 'android';
|
||||||
} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) {
|
} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) {
|
||||||
PLAT = 'ios';
|
PLAT = 'ios';
|
||||||
@ -61,7 +63,7 @@ if (!window._doNotWriteCordovaScript) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function backHome() {
|
function backHome() {
|
||||||
if (window.device && device.platform && device.platform.toLowerCase() == 'android') {
|
if (window.device && device.platform && (device.platform.toLowerCase() == 'android' || device.platform.toLowerCase() == 'amazon-fireos')) {
|
||||||
navigator.app.backHistory();
|
navigator.app.backHistory();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user