-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Permissions API #1828
feat: Permissions API #1828
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added two suggestions, will apply them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few changes, but I'll make them
example/src/pages/camera/camera.ts
Outdated
@@ -1,6 +1,6 @@ | |||
import { Component, NgZone } from '@angular/core'; | |||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; | |||
import { IonicPage, NavController, NavParams } from 'ionic-angular'; | |||
import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular'; | |
import { IonicPage, NavController, NavParams } from 'ionic-angular'; |
remove unused AlertController
example/src/pages/camera/camera.ts
Outdated
constructor(public navCtrl: NavController, | ||
public navParams: NavParams, | ||
private zone: NgZone, | ||
private sanitizer: DomSanitizer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private sanitizer: DomSanitizer, | |
example/src/pages/camera/camera.ts
Outdated
public navParams: NavParams, | ||
private zone: NgZone, | ||
private sanitizer: DomSanitizer, | ||
private alertCtrl: AlertController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private alertCtrl: AlertController) { | |
This adds a new API called
Permissions
that lets a developer check if certain permissions have been granted yet before requesting them.It largely follows the Permissions API in the browser.
Examples:
Also couldn't help myself and fixed bug in the Geolocation API for Android where calling
requestPermissions
would cause therequestPermissions
call to return over and over again, which really should only happen when the requestPermission called happened onwatchPosition
. I don't think this method is really used anywaysAlso fixed a bug in Camera where it was creating the image picker on a background thread