Android客户端到客户端消息传递,没有我自己的GCM服务器 [英] Android client to client messaging without my own server for GCM

查看:114
本文介绍了Android客户端到客户端消息传递,没有我自己的GCM服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想要做的 - 从device1上的MyApp开始,可以将消息发送给设备2上的MyApp。设备2应该收到此消息并显示通知。



我没有自己的应用程序服务器将通知从GCM推送到GCM客户端。这可能吗?如何做到这一点?



我调查的是 - PubNub,它有一个试用版许可证,似乎可以满足我在不需要服务器的情况下在频道上发送消息的需要。 p>

在SO上的讨论并没有多大帮助。

将客户端消息发送到客户端消息而无需与服务器交互

可以任何人都会建议更好的方法?

解决方案

您基本上必须以某种方式使用服务器。我认为 Firebase 对你而言是完美的。它有一个你可以使用的Android插件,它会在数据库中发生变化时基本上提醒你的应用程序。以下是功能的文档。请参阅此示例以获得实施。在你使用这个插件之前,你需要创建一个账户,而不是基本的账户是免费的。以下是说明


I am doing a prototype that involves messaging between clients.

What I want to do - from MyApp on device1, able to send message to MyApp on device2. Device2 should receive this and show a notification.

I don't have my own application server to push notifications from GCM to GCM clients.Is this possible ? How to do it ?

What I investigated - PubNub, which has a trial license that seems to answer my need to send messages on a channel without needing a server.

This discussion at SO didn't help much.

sending client to client messages without server interaction

Can anyone suggest better ways ?

解决方案

You basically have to use a server in one way or another. I think Firebase would be perfect for your purposes. It has an Android plugin you can use that will basically alert your app when something changes in the database. Here is the documentation for that feature. Take a look at this example for implementation. Before you can use the plugin, you need to create an account and whatnot (basic one is free). Here are the instructions.

这篇关于Android客户端到客户端消息传递,没有我自己的GCM服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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