检测何时创建新帐户或处理订阅请求?

发布于 2024-12-11 02:51:17 字数 542 浏览 6 评论 0原文

我们正在开发一个基于 XMPP 的通知系统,我们有一个服务器和几个 Android 设备,我们的 OpenFire 服务器充当通信网关。

在服务器端,有一个OSGi包,它负责接收来自设备的所有消息并映射相应的操作。

我想避免匿名登录,以便对谁向服务器发送消息有一定的控制,但另一方面,我希望客户端在使用我们的 android 客户端时自动注册。

好吧,我的第一个想法是监听AccountManager并检查任何新创建的帐户,如果继续,将其添加到服务器名册中。
第二个选项是处理所有订阅请求,检查所有内容,并将其添加到服务器名册中以防万一。显然,对于第二个选项,客户端需要向服务器请求订阅,但这很容易实现。

我在此处找到了第二个选项的可能解决方法,但是你们认为最好的选择是什么?

除了这两个之外,也欢迎任何其他推荐/建议。

We are developing a XMPP-based notification system, we have a server and several android devices and our OpenFire server acts as a communication gateway.

On the server side, there is a OSGi bundle, which is responsible to receive all the messages from the devices and map the corresponding action.

I want to avoid anonymous login, to have some control of who is sending messages to the server, but on the other hand I want the client to auto-signup when using our android-client.

So well, my first idea was either to listen to the AccountManager and check any newly createad account and, if proceeds, add it to the server roster.
The second option is handling all the subscription requests, check whatever, and add it to the server roster in case. Obiously for the second option the client needs to request the subscription to the server, but it's easy to achieve.

I found a possible workaround for the second option here, but what option you guys think is the best?

Any other recommendation/suggestion besides these two is also welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不顾 2024-12-18 02:51:17

它看起来像 pubsub (XEP-0060)会更合适,因为它根本不需要您的名册管理。 Android 设备成为发布者,而您的捆绑包将成为订阅者。

根据有限的信息,您似乎可以简单地让所有用户成为同一单个节点的发布者,然后发布服务器端包将订阅并相应处理的消息。

Smack on pubsub 的一些文档。

It looks like pubsub (XEP-0060) would be a better fit, since it doesn't require your roster management at all. The android devices become publishers and your bundle will be a subscriber.

Based on limited information, it looks like you could simply have all users become publishers to the same single node, and then publish messages that the server side bundle will subscribe to and handle accordingly.

Some docs for Smack on pubsub.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文