如何在 Flutter Firebase 应用中搜索并向附近的人发送通知? [英] How to search and send notifications to people nearby in flutter firebase app?

本文介绍了如何在 Flutter Firebase 应用中搜索并向附近的人发送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方法来搜索附近的人并向他们发送推送通知.看来我不能为此使用主题,所以可能需要一种查询用户的方法?

I need a way to search for people nearby and send them a push notification. Doesn't seem like I can use topics for this, so probably need a way to query for users?

推荐答案

  1. 在 Firestore 中保存用户位置(使用地理定位器插件)

  1. save users locations in firestore (using geolocator plugin)

获取当前用户位置(使用地理定位器插件)

get current user location (using geolocator plugin)

计算用户与其他用户之间的距离(使用地理定位器插件)

Calculate the distance between the user and other users (using geolocator plugin)

Geolocator().distanceBetween();

  • 以条件为例 if(distance < 200) show users

  • Put a condition as example if(distance < 200) show users

    向所选用户发送通知(Firebase 云消息传递)

    send a notification to the selected user (Firebase Cloud Messaging)

    抱歉,我无法提供更多详细信息,因为它们有很多问题.

    Sorry I couldn't give more details because they are many questions.

    这篇关于如何在 Flutter Firebase 应用中搜索并向附近的人发送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆