Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 346
AMoraga Avatar asked Nov 06 '12 12:11

AMoraga


People also ask

Do push notifications work offline?

Good news: You can send web push notifications to your subscribers even if they're offline. They can still see your notifications when they come back online.

Can you send mobile push notifications without an app?

Pushed allows you to send real-time notifications without developing your own app to iOs, Android and Desktop devices. Want to send push notifications? You're in the right place. Send it with Pushed.

How does push notifications work on the iOS platform?

An iOS push notification is a message that pops up on an Apple device such as an iPhone. Before receiving push notifications from an app, iOS device users must explicitly give permission. Once a user opts-in, mobile app publishers can send push notifications to the users' mobile devices.

What do you need to do to integrate push notifications in an iOS app?

Setting up Push Notifications in iOS. Go back to the iOS project you created earlier and select the main target. Under the Signing & Capabilities tab, click on the + Capability button, then select Push Notifications. This will enable your app to receive push notifications from OneSignal.


1 Answers

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.

like image 173
Artur Hefczyc Avatar answered Oct 17 '22 02:10

Artur Hefczyc