简体   繁体   English

为群组中的离线用户推送XMPP聊天应用程序的通知

[英]Push notification for XMPP Chat App for offline users in Group

Everyone....!! 大家....!!

Greetings..!! 问候..!!

I am working on XMPP based Chat app . 我正在开发基于XMPP的聊天应用程序。 I have used XMPPFramework by Robbie Hanson https://github.com/robbiehanson/XMPPFramework 我使用过Robbie Hanson的XMPPFramework https://github.com/robbiehanson/XMPPFramework

i have used OpenFire as XMPP Server 我使用OpenFire作为XMPP服务器

I am facing problem to get Push Notification for Group Chat when user is offline. 当用户离线时,我面临着获取群聊的推送通知的问题。

Currently I am able to get Push Notification for One to One Chat when user is offline . 目前,当用户离线时,我可以获得一对一聊天的推送通知。 (For this I have created a PHP WebService which fetches the information from ofOffline Table every 60 sec) (为此我创建了一个PHP WebService,它每隔60秒从一个离线表中获取信息)

But As there are no Offline messages Tables for Group Chat. 但由于没有离线消息表进行群聊。

Can anyone suggest me How can I get push notification to group when user is offline in group 任何人都可以建议我当用户在组中离线时,如何将推送通知分组

I need to manage this from Both Android n iOS Chat App 我需要从Android和iOS聊天应用程序中管理这个

for Android i am using 对于Android我正在使用

https://github.com/siacs/Conversations https://github.com/siacs/Conversations

The best example would be AMP implementation in the Tigase. 最好的例子是Tigase中的AMP实现。 It is based on a MessageAmp plugin and AMP component. 它基于MessageAmp插件和AMP组件。 The MessageAmp plugin intercepts messages. MessageAmp插件拦截消息。 If it detects that the user is not logged in, it forwards the message to AMP component to store it in an offline storage. 如果它检测到用户未登录,则会将消息转发到AMP组件以将其存储在脱机存储中。 In your case, you could have your own Message plugin which, if it detects that the user is offline, could forward the message to your Push component (iOS push or Android push, SMS push or something else). 在您的情况下,您可以拥有自己的Message插件,如果它检测到用户处于离线状态,则可以将消息转发到Push组件(iOS推送或Android推送,SMS推送或其他内容)。 And all the logic responsible for actual pushing notification to the device should be implemented in that component. 并且应该在该组件中实现负责实际向设备推送通知的所有逻辑。

Try checking this MUC - Light and use the mod_zeropush module to modify a bit to handle single and group push from the muc-light. 尝试检查此MUC - Light并使用mod_zeropush模块修改一个位以处理来自muc-light的单个和组推送。

Its more like whats app , although you may not achieve 100% results as you expect but less complex than the tradition XEP-0045. 它更像是什么应用程序,虽然你可能没有达到预期的100%结果,但不如传统的XEP-0045复杂。

Look into ejabberd_mod_offline_post 查看ejabberd_mod_offline_post

  1. First config the Room must be a Member-Only room, and add all users as members right after you created it, so that be able to get a total. 首先配置房间必须是仅限会员的房间,并在创建后立即将所有用户添加为成员,以便能够获得总数。
  2. Add above model into ejabberd models. 将以上模型添加到ejabberd模型中。
  3. Implement a Callback Service to handle the callback post. 实现回调服务来处理回调帖子。

The idea is when User go offline 这个想法是用户离线时

  • In one-to-one case, offline_message_hook will be raised 在一对一的情况下,将引发offline_message_hook
  • In MUC case, muc_filter_message will be raised, and any one not Presence-Available is offline. 在MUC情况下,将引发muc_filter_message,并且任何不是Presence-Available的人都将脱机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM