feat(badge) add isSupported function

feat(badge) add isSupported function
This commit is contained in:
Daniel Sogl 2018-03-16 16:35:27 +01:00 committed by GitHub
commit 6dcebd03ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/** /**
* @name Badge * @name Badge
* @description * @description
@ -31,13 +30,14 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
}) })
@Injectable() @Injectable()
export class Badge extends IonicNativePlugin { export class Badge extends IonicNativePlugin {
/** /**
* Clear the badge of the app icon. * Clear the badge of the app icon.
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
*/ */
@Cordova() @Cordova()
clear(): Promise<boolean> { return; } clear(): Promise<boolean> {
return;
}
/** /**
* Set the badge of the app icon. * Set the badge of the app icon.
@ -45,14 +45,18 @@ export class Badge extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
set(badgeNumber: number): Promise<any> { return; } set(badgeNumber: number): Promise<any> {
return;
}
/** /**
* Get the badge of the app icon. * Get the badge of the app icon.
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
get(): Promise<any> { return; } get(): Promise<any> {
return;
}
/** /**
* Increase the badge number. * Increase the badge number.
@ -60,7 +64,9 @@ export class Badge extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
increase(increaseBy: number): Promise<any> { return; } increase(increaseBy: number): Promise<any> {
return;
}
/** /**
* Decrease the badge number. * Decrease the badge number.
@ -68,20 +74,34 @@ export class Badge extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
decrease(decreaseBy: number): Promise<any> { return; } decrease(decreaseBy: number): Promise<any> {
return;
}
/**
* Check support to show badges.
* @returns {Promise<any>}
*/
@Cordova()
isSupported(): Promise<any> {
return;
}
/** /**
* Determine if the app has permission to show badges. * Determine if the app has permission to show badges.
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
hasPermission(): Promise<any> { return; } hasPermission(): Promise<any> {
return;
}
/** /**
* Register permission to set badge notifications * Register permission to set badge notifications
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
registerPermission(): Promise<any> { return; } registerPermission(): Promise<any> {
return;
}
} }