XMPP (Openfire) 推送通知 Android [英] XMPP (Openfire) Push Notifications Android

查看:35
本文介绍了XMPP (Openfire) 推送通知 Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的试图找到解决这个问题的方法,但没有.有一些线程与此概念相关,但我没有找到全面的解决方案.

I really tried to find a solution to this problem but didn't. There are some threads related to this concept, but I didn't find a comprehensive solution.

我有一个带有 Openfire 的服务器,可以发送消息.当两个用户都在线时,没有问题.但是,当用户离线时,我想发送推送通知,就像在 Whatsapp 中一样.我听说 Whatsapp 和其他 IM 应用程序使用修改版的 ejabber 发送推送通知,但不知道如何.

I have a server with Openfire which sends messages. When both users are online, there is no problem. However, when a user is offline I would like to send a push notification, as in Whatsapp. I heard that Whatsapp and other IM apps use a modified version of ejabber to send push notifications, but couldn't find out how.

一种可能性是使用 GCM,但我不确定这是否是正确的方法.另外我想避免轮询,以免耗尽电池寿命.

One possibility is to use GCM, but I am not sure if this is the right way to go. Also I would like to avoid polling, for the sake of not draining battery life.

有没有人知道一些解决方案或有一个例子?

Does anyone know some solution to this or has an example?

推荐答案

好吧,您可以将 GCM 与 XMPP 结合使用.新的 GCM 云连接服务器允许您将 XMPP 协议用于双向 (云到设备和设备到云)服务器和 Android 应用之间的通信.

Well, you could use GCM with XMPP. The new GCM Cloud Connection Server allows you to use the XMPP protocol for a bidirectional (Cloud to Device and Device to Cloud) communication between your server and your Android application.

GCM 云连接服务器 (CCS) 允许第三方服务器通过建立持久性 TCP 与 Android 设备通信使用 XMPP 协议与 Google 服务器连接.这通信是异步和双向的.

The GCM Cloud Connection Server (CCS) allows third party servers to communicate with Android devices by establishing a persistent TCP connection with Google servers using the XMPP protocol. This communication is asynchronous and bidirectional.

这篇关于XMPP (Openfire) 推送通知 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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