WhatsApp/Telegram like calling 功能在 Flutter 中的实现

Implementation of WhatsApp/Telegram like calling feature in Flutter

当flutter应用程序在后台或从最近的任务中清除(清除ram)时,如何实现WhatsApp/Telegram之类的呼叫通知?谁能告诉我具体怎么做?

您可以使用 flutter_local_notifications plugin with the firebase_messaging 插件。

来自 flutter_local_notifications 插件的文档;

  • [Android] Support for the following notification styles
    Big picture
    Big text
    Inbox
    Messaging

来自 firebase_messaging 插件的文档;

With this plugin, your Flutter app can receive and process push notifications as well as data messages on Android and iOS.

YouTube 上有一个关于这个主题的精彩系列。在该系列中,一位名叫 CS Guy 的 YouTuber 创建了 Skype 的克隆。我已将 link 放在视频中,他解释了如何在用户呼叫另一个用户时创建弹出屏幕,但是,您可能需要观看该系列中以前的视频才能使一切正常.它很长,但我建议您观看整个过程。在呼叫用户时显示通知方面,我建议您观看下面列出的 Fireship 的视频。在视频中,他解释了当 Firestore 中发生特定事件时,如何在后台发送通知。

我无法详细解释实现您想要的内容的整个过程,但我可以大致概述您需要做什么。

  1. 观看 CS Guy 的 video/entire 系列并完成所有内容
  2. 了解如何从 Fireship 在 firebase 中发送推送通知
  3. 在调用集合中创建新文档时(读完cs guy系列你就会明白)触发云函数。
  4. 在云函数中找到调用接收者的 uid,并从 Firestore 中获取用户的令牌。
  5. 最后,向接收者发送通知,告知他们有来电。

计算机专家: https://youtu.be/v9ngriCV0J0

火船:https://youtu.be/2TSm2YGBT1s

我在我的申请中做了完全相同的事情,如果您需要进一步的帮助,我可以帮助您,但是,请先完成这两个 videos/series。