0
votes

I made chat app in ios but in ios 10 xmpp not working in background.

For that i have found one solution pushkit used for run xmpp in background but i not understand how to implement xmpp + push kit.

So any one have idea or code about xmpp +push kit or ios 10 xmpp run in background then please help me.

Thanks.

1

1 Answers

0
votes

Before iOS 10, we have a voip socket which will wake your app up even in background if some packets are received even in background. But since iOS 10, we will not get the cpu time, so pushkit will be te last resort.

If you want to use pushkit, you must make sense it's just a way to wake you up when you are suspended or even you are killed. When you want to send a message to the remote one, you will need to send a http push message to APNS, and the message with its payload will be delivered (If it's enough, you can even skip your xmpp part).

If you insist on the xmpp communication, you may need to store the message after you send the APNS message, and when the remote app is waked up and connected to your xmpp server, the server send all the cached messages to the client to make these messages delivered.

It's quite complex as some changes are really necessary on your server.