【问题标题】:How can I check if push notifications were disabled in React Native using PushNotificationIOS?如何使用 PushNotificationIOS 检查是否在 React Native 中禁用了推送通知?
【发布时间】:2018-04-04 01:45:05
【问题描述】:

我想确定使用 React Native 和 PushNotificationIOS 的用户是否禁用了推送通知。

PushNotificationIOScheckPermissions 方法,但这个方法只告诉我是否启用通知。

我想使用 React Native 来判断我的应用是否提示用户启用通知而用户拒绝了该权限,或者用户是否独立进入设置并禁用通知。

在本机代码中,您将使用 UNUserNotificationCenter 并检查 getNotificationSettings 以获取具有值 .deniedauthorizationStatus

谢谢。

【问题讨论】:

  • 这个有进展吗?

标签: react-native


【解决方案1】:

我可以建议你试试this library。该库具有您上面提到的所有功能。对我来说这很好,希望你也一样。

【讨论】:

    猜你喜欢
    • 2016-03-24
    • 2016-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-01
    • 1970-01-01
    相关资源
    最近更新 更多