cordova-plugin-firebase-messaging icon indicating copy to clipboard operation
cordova-plugin-firebase-messaging copied to clipboard

How to check permission without requesting it ?

Open m0dch3n opened this issue 5 years ago • 5 comments

Before I used the cordova-plugin-firebase plugin from arnesson, where the following method existed

https://github.com/arnesson/cordova-plugin-firebase/blob/master/docs/API.md#haspermission

How can I do this, with your plugin ? My intent is, to first check if the user has given the permission, and if not, I first want explain why I'll ask for it, before I gonna request...

m0dch3n avatar Jun 17 '19 14:06 m0dch3n

You can do it with Cordova diagnostic plugin

fermedina avatar Jun 17 '19 14:06 fermedina

You can do it with Cordova diagnostic plugin

looks nice, and thanks for the tip!

But maybe this is a little bit an overkill, to integrate a whole plugin with so many features, for just a small check. If I don't need all the rest, this will unnecessary increase the size of my app.

Anyway let's see what @chemerisuk has to say about this ?

m0dch3n avatar Jun 17 '19 14:06 m0dch3n

I don't feel this method is often needed. iOS provides a way to customize text in permission dialog where you can explain why. To show a different kind of screen at the first time - use a persistable flag.

chemerisuk avatar Jun 29 '19 06:06 chemerisuk

I am currently switching over to this plugin from cordova-plugin-firebase as well, and need this method as part of a complex authentication process on startup. Is there another way to check?

thwbs avatar Jul 02 '19 13:07 thwbs

@WolftechBroadcastSolutions

As I also have local notifications, I used this plugin with the method hasPermission

It better fits my requirements, without bloating the app bundle too much with the diagnostic plugin.

But IMHO it would be better, if cordova-plugin-firebase-messaging would also be able to allow us to check, without requesting for it.

Unfortunately, I don't have any iPhone Dev knowlegde, so I'm unable to implement this natively as proposed by @chemerisuk

m0dch3n avatar Jul 02 '19 14:07 m0dch3n