iosxmppapple-push-notificationsxmppframeworktigase

iOS - Send push notification on XMPP chat app when buddy is offline


I have an iOS chat app like Whatsapp. The chat is running well with XMPP protocol. The app has other functionalities, and has an APNS service running well with them. For the client I'm working with XMPPFramework, and for the server with PHP and Tigase for the XMPP server.

The question is this:

How to make the server send a push notification to an user, when the XMPP server receives a message for him and his presence is false?

Thanks!


Solution

  • The best example would be AMP implementation in the Tigase. It is based on a MessageAmp plugin and AMP component.
    The MessageAmp plugin intercepts messages. If it detects that the user is not logged in, it forwards the message to AMP component to store it in an offline storage. 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).
    And all the logic responsible for actual pushing notification to the device should be implemented in that component.