dousi2013 2015-11-27 07:18
浏览 36

找到存在然后发送推送通知

I am using Openfire for the xmpp server and so far its been great. The problem I am facing now is with push notifications. The app is written in Xcode which gets user data from a PHP Api. Openfire is the xmpp server. The issue is that when the app sends a message to openfire I would need to also query the Php api to see if the user is online and if they are not, send a push notification. This would have to happen for each message sent and as you might guess that will affect performance with all those requests happening.

I have everything working, I just cant get past this hump. If only openfire would fife off a request of my choice upon receiving a message.

Can anyone suggest a better idea? Basically need to know if the user is online (presence) before so that I know to fire off the push notification.

One thing also for sending push notification php script is right or openfire have some plugin.

Thanks.

  • 写回答

1条回答 默认 最新

  • dtvp3625 2015-11-27 09:15
    关注

    I think using php script to check for offline user is an expensive affair.

    I have used ejabberd server. For which you can create custom modules using "offline_message_hook" and using this module you can invoke php script to send push notification.

    This hook is called when someone send message to an offline user. Following link might be helpful.

    http://jasonrowe.com/2011/12/30/ejabberd-offline-messages/

    If you are stuck somewhere, I can help.

    评论

报告相同问题?

悬赏问题

  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器