【问题标题】:How to get local-notification without Apns for ios in react-native?如何在 react-native 中获得没有 Apns for ios 的本地通知?
【发布时间】:2018-06-28 14:47:05
【问题描述】:

我在一些通知库中搜索了 react-native。

https://github.com/zo0r/react-native-push-notification

这适用于 Android,但它需要适用于 ios 的 Apns

我想找一些不需要Apns和简单的库。

【问题讨论】:

    标签: react-native react-native-android react-native-ios


    【解决方案1】:

    无法避免使用APNS 进行远程推送通知。

    为了在某些情况下接收数据,例如让您的应用在后台运行、手机处于离线状态以及稍后在重新上线后收到通知,您的设备必须具有由 Apple 生成的唯一的应用专用设备令牌.然后,您可以使用FCMAWS SNS 等服务将通知传递给客户。

    此外,对于 Android,您将需要使用 GCM 来生成设备令牌。

    出于测试目的,您可以使用react-native-push-notifications'PushNotification.localNotificationSchedule 创建一个虚拟本地通知。

    这里有一个很好的使用 APNS 和 FCM 设置远程推送通知的教程:https://www.appcoda.com/firebase-push-notifications/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-22
      • 1970-01-01
      • 2018-12-29
      • 1970-01-01
      • 1970-01-01
      • 2021-07-23
      • 1970-01-01
      相关资源
      最近更新 更多