Merge branch 'master' into v5

This commit is contained in:
Daniel
2018-12-01 16:55:01 +01:00
parent 31e4058257
commit 165c3cc211
20 changed files with 904 additions and 192 deletions
+27 -1
View File
@@ -10,6 +10,17 @@ import { Observable, merge } from 'rxjs';
declare const navigator: any;
export enum Connection {
UNKNOWN = 0,
ETHERNET,
WIFI,
CELL_2G,
CELL_3G ,
CELL_4G,
CELL,
NONE
}
/**
* @name Network
* @description
@@ -23,7 +34,7 @@ declare const navigator: any;
*
* ...
*
* // watch network for a disconnect
* // watch network for a disconnection
* let disconnectSubscription = this.network.onDisconnect().subscribe(() => {
* console.log('network was disconnected :-(');
* });
@@ -61,6 +72,21 @@ declare const navigator: any;
})
@Injectable()
export class Network extends IonicNativePlugin {
/**
* Constants for possible connection types
*/
Connection = {
UNKNOWN: 'unknown',
ETHERNET: 'ethernet',
WIFI: 'wifi',
CELL_2G: '2g',
CELL_3G: '3g',
CELL_4G: '4g',
CELL: 'cellular',
NONE: 'none'
};
/**
* Connection type
* @return {string}