react-native firebase request permissions always result in an exception.
I am trying to give the user the option to allow notifications in my react-native app. So, when the user install my react-native app an alert will be shown and he can choose whether to allow notifications on the app or not. I am using react-native-firebase to handle this. however, the firebase "requestPermission" function always fails whatever I click "allow" or "Not Allow".
firebase.messaging().requestPermission()
.then(() => {
console.log('User Now Has Permission')
})
.catch((error) => {
console.log('Error', error)
})