I Have done a XMPP chat app in which I am using Voip service for getting the Voip key in order to recieve the chat message when I am in background. The functionality all wor
You cannot use VoIP with having implemented VoIP in your app just because it provides some cool background functionalities. The only way you can receive messages when the app is killed is through APNS push notifications that needs to be configured on the server accordingly and recreate the connection once the app is launched again. You can show local notifications when the app is in the background, but when connection with the XMPP server is offline, you must send a push notification.
Although, the challenge here is getting delivery receipts for messages when push notifications are sent. That, if you're handling delivery receipts, it will be a challenge.
You can't just add voip
flag and get approved by Appstore, you need to implement VOIP functionality or you will be rejected. Most XMPP applications in Appstore does not work in background, but some of them implements VOIP over Jingle and get approved with voip
flag.
On the other hand, if your application stick to your XMPP server, you can modify server behaviour - stay user session online even if he disconnected, manage received messages and notify user about it via Apple Push Notifications. Then user launch app, resume previous session and get all stored messages. This behaviour not yet standartized, but there is some work-in-progress specification.