bugfix: add response type to permission checking (#3149)

This commit is contained in:
Saninn 2019-08-30 15:53:47 +02:00 committed by Daniel Sogl
parent 73493e222f
commit 3a5c790a56

View File

@ -204,20 +204,20 @@ export class AndroidPermissions extends IonicNativePlugin {
/** /**
* Check permission * Check permission
* @param {string} permission The name of the permission * @param {string} permission The name of the permission
* @return {Promise<any>} Returns a promise * @return {Promise<AndroidPermissionResponse>} Returns a promise
*/ */
@Cordova() @Cordova()
checkPermission(permission: string): Promise<any> { checkPermission(permission: string): Promise<AndroidPermissionResponse> {
return; return;
} }
/** /**
* Request permission * Request permission
* @param {string} permission The name of the permission to request * @param {string} permission The name of the permission to request
* @return {Promise<any>} * @return {Promise<AndroidPermissionResponse>}
*/ */
@Cordova() @Cordova()
requestPermission(permission: string): Promise<any> { requestPermission(permission: string): Promise<AndroidPermissionResponse> {
return; return;
} }
@ -234,10 +234,14 @@ export class AndroidPermissions extends IonicNativePlugin {
/** /**
* This function still works now, will not support in the future. * This function still works now, will not support in the future.
* @param {string} permission The name of the permission * @param {string} permission The name of the permission
* @return {Promise<any>} Returns a promise * @return {Promise<AndroidPermissionResponse>} Returns a promise
*/ */
@Cordova() @Cordova()
hasPermission(permission: string): Promise<any> { hasPermission(permission: string): Promise<AndroidPermissionResponse> {
return; return;
} }
} }
export interface AndroidPermissionResponse {
hasPermission: boolean;
}