Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

[Suggestion] Permission Request method for iOS #2085

Open
pitAlex opened this issue Dec 1, 2017 · 5 comments
Open

[Suggestion] Permission Request method for iOS #2085

pitAlex opened this issue Dec 1, 2017 · 5 comments

Comments

@pitAlex
Copy link

pitAlex commented Dec 1, 2017

Hello,
In my current app, I show a custom dialog when user first runs the app to ask him if he wants to receive or not notifications. Its only when he accepts that I initiate the plugin. However this setup forces me to use this plugin : https://github.com/katzer/cordova-plugin-local-notifications
that has a "requestPermision" method which will tells me if user has allowed notifications or not when the system dialog for notifications shows up. Is there any plans to implement such functionality? It would definitely help me out not longer rely on the additional plugin as currently the register event doesn't tell you if user has allowed it or not.

@macdonst
Copy link
Member

macdonst commented Dec 1, 2017

@pitAlex
Copy link
Author

pitAlex commented Dec 1, 2017

Thats different. It will just tell you if permissions are granted or not. The method I am talking about actually fires the iOS system "notifications enable" dialog and waits for user's response before triggering the callback.
To make thing clear on my scenario. I have a custom overlay and if user "accepts" then the system dialog shows up because I am calling .requestPermission of that plugin.
In the phonegap-plugin-push, that dialog shows up if we do registration, but does not wait for user input.
I saw a similar thing referenced here : #2004
It was marked as duplicate, but its what I am experiencing. Either the registration event should not fire until user has granted/denied permission or a new method like the "requestPermission" should be added.

@fredgalvao
Copy link
Collaborator

Either the registration event should not fire until user has granted/denied permission or a new method like the "requestPermission" should be added.

Agreed, and I'd say that the former is a more sensible way to think about it. I'd even say it should have been like that from the start. </my50cent>

@stale
Copy link

stale bot commented Jun 3, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@gecsbernat
Copy link

Hi!
I have a solution for this.
#2843

It enables automatic permission request when checkpermission called.
Simple way :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants