Flutter中WhatsApp/Telegram类通话功能的实现

Jay*_*gar 2 background-process phone-call flutter

当 flutter 应用程序在后台或从最近的任务(清除内存)中清除时,如何实现 WhatsApp/Telegram 之类的呼叫通知?任何人都可以让我知道究竟如何做到这一点?

Hud*_*Kim 7

There is a great youtube series on this exact topic. In the series, a YouTuber by the name of the CS Guy creates a clone of Skype. I've placed the link to the video where he explains how to create a pop-up screen when a user calls another user, however, you may need to watch the previous videos within the series in order to get everything working. Its quite long but I recommend you watch the entire thing. In terms of displaying notifications when a user is called, I recommend you watch a video by Fireship listed below. In the video, he explains how to send notifications in the background when a certain event occurs in Firestore.

I can't explain the entire process in detail to achieve what you want but I can give a general overview of what you would need to do.

  1. Watch the video/entire series by the CS Guy and complete everything
  2. Learn how to send push notifications in firebase from Fireship
  3. When a new document is created within the calls collection (You will understand once you finish the cs guy series) trigger cloud function.
  4. Find the uid of the receiver of the call within the cloud function and grab the user's token from Firestore.
  5. Finally, send a notification to the receiver telling them about the incoming call.

CS Guy: https://youtu.be/v9ngriCV0J0

Fireship: https://youtu.be/2TSm2YGBT1s

我在我的申请中做了完全相同的事情,如果你需要进一步的帮助,我可以帮助你,但是,请先浏览两个视频/系列。

  • 这个方法不起作用,这是一个 hack。当应用程序打开并且您位于正确的屏幕上时,它就会起作用。它不像 WhatsApp/Telegram (2认同)