简体   繁体   English

本地反应如何控制何时在IOS中提示用户输入推送通知权限

[英]react native How to control when to prompt user for push notification permissions in IOS

I'm looking a way to control in react native when to prompt user for push notification permission in IOS and if there is way to get any callback if user presss allow or deny for prompt. 我正在寻找一种方法来控制React Native在何时提示用户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.

相关问题 如何控制何时在iOS中提示用户推送通知权限 - How to control when to prompt user for push notification permissions in iOS 如何在 IOS 上接收推送通知? - how to receive a push notification on IOS react native? 如何分辨何时使用了React-Native中的iOS通知权限请求 - How to tell when use has answered iOS Notification Permissions request in React-Native 当app在后台时,使用React Native进行无提示iOS推送通知 - Silent iOS Push Notification with React Native when app is in background 当应用被杀死时,如何在ios中单击通知时接收数据((react-native-fcm模块在iOS中获取推送通知) - How to receive data on click of notification in ios, when app is killed ,( react-native-fcm module to get push notification in IOS) 如何确定在iOS safari上何时提示用户位置权限? - How is it determined when to prompt user location permissions on iOS safari? 如何控制Netmera ios sdk何时提示“推送通知”权限? - How to control when Netmera ios sdk will prompt Push notifications permission? 如何在react-native-ios中实现推送通知 - How to implement Push Notification in react-native-ios 如何为React Native iOS应用程序更改本地推送通知图标 - How to change local push notification icon for React Native iOS app 使用图像响应本机 iOS 推送通知 - React Native iOS Push Notification with Image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM