【问题标题】:Flutter Push notification from a ASP.net rest API来自 ASP.net REST API 的 Flutter 推送通知
【发布时间】:2019-06-06 09:36:16
【问题描述】:

我使用 ASP .NET RestAPI 作为我的 Flutter 应用程序的后端,并希望在发生某些事件时向我的应用程序发送通知。实现这一点的最佳方法是什么?

【问题讨论】:

  • FCM 是两个平台的最佳方式!

标签: asp.net push-notification flutter


【解决方案1】:

我建议您使用 Firebase 云消息传递。

Flutter 有第一方插件 firebase_messaging

将 Firebase SDK 集成到您的 Flutter 应用程序很容易。

将 Firebase SDK 设置到您的 Flutter 应用程序后,您可以使用 FCM rest API 向您的应用程序发送推送通知。

请记住准备一个后端 API 来保存您的客户端(设备)FCM 令牌,因为您需要一个设备令牌来向特定设备发送推送通知。

【讨论】:

    【解决方案2】:

    您可以使用您的服务器或从 Flutter 应用程序的客户端发送 FCM 通知。使用 FCM 的 Rest API 并轻松发送通知。

    查看此帖子:https://arkapp.medium.com/flutter-fcm-rest-api-7719925f2e3e

    发布 API 网址:

    https://fcm.googleapis.com/fcm/send
    

    请求正文:

    {
    "to": "<FCM Token>",
    "priority": "high",
    "notification": {
        "title": "Hyree FCM testing",
        "body": "Testing the fcm notification for different fcm token",
        "sound": "default"
    } 
    

    }

    【讨论】:

      猜你喜欢
      • 2013-05-26
      • 2019-12-15
      • 2020-02-14
      • 1970-01-01
      • 2018-12-31
      • 2014-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多