React-native-fcm: feature request: checkPermissions method?

Created on 11 Aug 2016  路  2Comments  路  Source: evollu/react-native-fcm

It would be nice to have a checkPermissions method so i can show a priming message; 'we need permissions to do x' before actually asking for it and triggering the dialog. e.g.

  1. checkPermissions()
  2. if true; do nothing
  3. if false; show priming message
  4. requestPermissions() (triggering the permissions dialog)

It's not always enough to check if you already have a token or not to deduce permissions status. depending on how you store that token. so a simple method to check would be helpful.

Most helpful comment

@evollu i'll see what i can do!

The current setup does work. But it's good practice to prepare a user of your app for the upcoming permissions request by explaining why you need it. You only want to show that preparatory message if they have not yet given you the needed permissions though.

All 2 comments

permission alert only shows up when you don't have the permission. otherwise it doesn't do anything. Is that not enough?
pull is welcomed. I think react-native's PushNotificationIOS has the code

@evollu i'll see what i can do!

The current setup does work. But it's good practice to prepare a user of your app for the upcoming permissions request by explaining why you need it. You only want to show that preparatory message if they have not yet given you the needed permissions though.

Was this page helpful?
0 / 5 - 0 ratings