I am using react-native-permissions requestNotifications method to request permission from the user to receive notifications.
try {
const response = await requestNotifications(['alert', 'sound']);
if (response?.status === 'granted' ) {
const fcmToken = await messaging().getToken();
if (fcmToken) {
this.token = fcmToken;
}
}
} catch ( error ) {
console.error(error);
}
I am not sure to understand the behavior of the method. In my case, the method is called every time the app starts. How does the lib knows when to stop showing the popup when permission has been either declined or accepted, knowing that I don't use the checkNotifications method ? Is it checked under the hood when using requestNotifications ?