Created
July 18, 2017 12:38
-
-
Save anonymous/a8b8c128cf9e02b6081bf5c33344d39c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Platform } from 'ionic-angular'; | |
import { Diagnostic } from '@ionic-native/diagnostic'; | |
@Injectable() | |
export class PermissionsService { | |
constructor( | |
public _platform: Platform, | |
public diagnostic: Diagnostic | |
) { | |
} | |
checkCameraPermissions() { | |
return new Promise(resolve => { | |
this.diagnostic.requestCameraAuthorization().then(authorisation => { | |
resolve(authorisation == this.diagnostic.permissionStatus.GRANTED); | |
}); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment