mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +08:00
refactor(diagnostic):
This commit is contained in:
parent
f8330daa8b
commit
17214ffba7
@ -1,4 +1,5 @@
|
|||||||
import {Plugin, Cordova} from './plugin';
|
import { Cordova, Plugin } from './plugin';
|
||||||
|
|
||||||
|
|
||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'cordova.plugins.diagnostic',
|
plugin: 'cordova.plugins.diagnostic',
|
||||||
@ -10,28 +11,28 @@ export class Diagnostic {
|
|||||||
* Checks if app is able to access device location.
|
* Checks if app is able to access device location.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isLocationEnabled(): Promise<any> {return; }
|
static isLocationEnabled(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled.
|
* Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled.
|
||||||
* On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />`
|
* On Android this requires permission. `<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />`
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isWifiEnabled(): Promise<any> {return; }
|
static isWifiEnabled(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the
|
* Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the
|
||||||
* application is authorized to use it.
|
* application is authorized to use it.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isCameraEnabled(): Promise<any> {return; }
|
static isCameraEnabled(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile)
|
* Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile)
|
||||||
* On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" />
|
* On Android this requires permission <uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isBluetoothEnabled(): Promise<any> {return; }
|
static isBluetoothEnabled(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the location authorization status for the application.
|
* Returns the location authorization status for the application.
|
||||||
@ -40,27 +41,27 @@ export class Diagnostic {
|
|||||||
* mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
|
* mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static requestLocationAuthorization(mode?: string): Promise<any> {return; }
|
static requestLocationAuthorization(mode?: string): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the application is authorized to use location.
|
* Checks if the application is authorized to use location.
|
||||||
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isLocationAuthorized(): Promise<any> {return; }
|
static isLocationAuthorized(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if camera hardware is present on device.
|
* Checks if camera hardware is present on device.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isCameraPresent(): Promise<any> {return; }
|
static isCameraPresent(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the application is authorized to use the camera.
|
* Checks if the application is authorized to use the camera.
|
||||||
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return TRUE as permissions are already granted at installation time.
|
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return TRUE as permissions are already granted at installation time.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isCameraAuthorized(): Promise<any> {return; }
|
static isCameraAuthorized(): Promise<any> { return; }
|
||||||
/**
|
/**
|
||||||
* Checks if location mode is set to return high-accuracy locations from GPS hardware.
|
* Checks if location mode is set to return high-accuracy locations from GPS hardware.
|
||||||
* Returns true if Location mode is enabled and is set to either:
|
* Returns true if Location mode is enabled and is set to either:
|
||||||
@ -68,7 +69,7 @@ export class Diagnostic {
|
|||||||
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isGpsLocationEnabled(): Promise<any> {return; }
|
static isGpsLocationEnabled(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if location mode is set to return low-accuracy locations from network triangulation/WiFi access points.
|
* Checks if location mode is set to return low-accuracy locations from network triangulation/WiFi access points.
|
||||||
@ -77,7 +78,7 @@ export class Diagnostic {
|
|||||||
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
* - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy)
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isNetworkLocationEnabled(): Promise<any> {return; }
|
static isNetworkLocationEnabled(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if remote (push) notifications are enabled.
|
* Checks if remote (push) notifications are enabled.
|
||||||
@ -85,7 +86,7 @@ export class Diagnostic {
|
|||||||
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRegisteredForRemoteNotifications().
|
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRegisteredForRemoteNotifications().
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isRemoteNotificationsEnabled(): Promise<any> {return; }
|
static isRemoteNotificationsEnabled(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if the app is registered for remote (push) notifications on the device.
|
* Indicates if the app is registered for remote (push) notifications on the device.
|
||||||
@ -93,5 +94,5 @@ export class Diagnostic {
|
|||||||
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRemoteNotificationsEnabled().
|
* On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRemoteNotificationsEnabled().
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static isRegisteredForRemoteNotifications(): Promise<any> {return; }
|
static isRegisteredForRemoteNotifications(): Promise<any> { return; }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user