Skip to content

Instantly share code, notes, and snippets.

Created July 18, 2017 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a8b8c128cf9e02b6081bf5c33344d39c to your computer and use it in GitHub Desktop.
Save anonymous/a8b8c128cf9e02b6081bf5c33344d39c to your computer and use it in GitHub Desktop.
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