根据官方的react-native-firebase 文档,您可以使用ios方法requestPermissions()来提示用户接受通知,但是由于该方法返回void,我如何检查用户是否拒绝通知?
Looks like the docs incorrectly state that it returns void, it actually returns a promise that resolves with an object - we'll get the docs updated.
On iOS 9 or below, there's no way to tell whether the user accepted or rejected the permissions popup - in this case the object will have a property called status
with a value of "unknown"
In all other cases the object will have a granted
property which is a boolean value of true/false.
EDIT: I've updated the docs to reflect the above.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.