Android的Firebase设备到设备的消息传递 [英] android firebase device to device messaging

查看:168
本文介绍了Android的Firebase设备到设备的消息传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个应用程序,可以简单地使用firebase允许用户添加朋友,并能够发送一个消息,如whatsapp,但用户名。



我已经看到并使用了firebase聊天的例子,但它并没有帮助我理解如何创建设备到设备的消息传递,而是在应用程序中的每个人之间分组消息,我不想要。

我见过很多聊天应用程序的例子,但都是过时的(PARSE / DEPRECATED FIREBASE)或者不清楚如何创建它。 解决方案Firebase不支持两个设备之间的直接通信。你需要一个额外的应用程序服务器与gcm通信。一篇很好的文章帮助我理解结构可以在这里找到。 http://www.grokkingandroid.com/xmpp-server-google-cloud-消息/ 。一个很好的项目对我来说是友好的例子 https://github.com/googlesamples/friendlyping

I want to create an app that can simply using firebase allow users to add friends and be able to send one to one messages like whatsapp but with usernames.

I have seen and used the firebase chat example but it doesn't help me understand how to create device to device messaging but instead group messaging between everyone on the app which i don't want.

I have seen many examples of chat apps but all are out of date (PARSE/DEPRECATED FIREBASE) or unclear on how to create it.

解决方案

Firebase does not support direct communication between two devices. You need an additional app server that communicates with gcm. A nice article that helped me to understand the structure can be found here. http://www.grokkingandroid.com/xmpp-server-google-cloud-messaging/. A nice project that worked for me is the friendlyPing example https://github.com/googlesamples/friendlyping.

这篇关于Android的Firebase设备到设备的消息传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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