如何实现XMPP发送推送通知 [英] How to implement XMPP to send push notifications

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

问题描述

我想使用XMPP,这样我的应用程序将发送更新Android手机(1.5或更高)。我pretty的多少要使用XMPP发送推送通知到手机上。

I would like to use XMPP so that my application will send out updates to an android phone (1.5 and higher). I pretty much want to use XMPP to send push notifications to the phone.

如何,我会去实现这一目标。此刻我的web应用程序是Apache tomact拥有一批这样的servlet Android手机可以访问信息的运行,但我发现很难理解我怎么能实现XMPP,这样我可以从服务器推信息到客户端( android手机)。

How would i go about achieving this. At the moment my web application is running on apache tomact with a number of servlets so the android phone can access information, but I'm finding it difficult understanding how I could implement XMPP so that I can push information from the server to the client (android phone).

我已经测试了下面的教程 XMPP的实例谷歌ID登录

I have tested the below tutorial Example of XMPP with Google ID login

它使用谷歌ID登录。但我需要用我的web应用做谷歌实现。 任何想法?

It uses Google ID logins. But i need to use my webapplication to do what google implements. Any ideas?

推荐答案

这将取决于你推的性质(是点对点或酒吧分)。在这两种情况下,你需要你的客户和应用程序连接到一个XMPP服务器。这将是用于应用程序发送通知到客户端。

That would depend on the nature of your push (is it a point to point or pub sub). In either case, you will need an XMPP server that your clients and application are connected to. This will be the means for your application to send notifications to the clients.

不知道你的意思是我需要用我的web应用到什么谷歌工具。你的web应用将是一个客户端XMPP服务器,就像你的手机。不能使用XMPP来简单谈谈你的web应用,除非它碰巧是波什启用XMPP服务器本身,我猜是不可能的。

Not sure what you mean by "I need to use my webapplication to what google implements". Your webapplication would be a client to the xmpp server, just like your phones. You cannot use xmpp to simply talk to your webapplication, unless it happens to be a bosh enabled xmpp server itself, which I would guess is not likely.

您可以使用了解你的客户沟通,及many可用服务器的。

You can use Smack for your client communications, and any one of the many available servers.

如果通信是针对特定的客户端,然后创建一个聊天该应用程序和客户端之间可能是最简单的装置。如果它更是一个广播,那么你可以使用任何<一href="http://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions/index.html">MUC (多用户聊天)或<一href="http://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions/index.html">pubsub.

If the communication is directed at specific clients, then creating a chat between the application and client is probably the simplest means. If it is more of a broadcast, then you could use either MUC (multi user chat) or pubsub.

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

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