[英]react native How to control when to prompt user for push notification permissions in IOS
I think you are using react-native-fcm . 我认为您正在使用react-native-fcm 。 If you use react-native-firebase , you can prompt users to give permission so, as follows:
如果使用react-native-firebase ,则可以提示用户授予权限,如下所示:
firebase.messaging().hasPermission()
.then(enabled => {
if (enabled) {
// user has permissions
} else {
// user doesn't have permission
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.