I am doing a chat Application in IOS using XMPP Framework . Previously it was not working in background but now i need to send local notification when user receive a message . My app don't use push notification for this feature because in same app in android device is sending local notification when user receive a message.
I have tried some docs over internet and found that app will not support in background and i need to check VOIP in back ground mode , but docs also said that there is a chance to reject the app by apple .
Here is my code for that :
- (void)applicationDidEnterBackground:(UIApplication *)application{
XMPPPresence * presence =[XMPPPresence presence];
[[self xmppStream] sendElement:presence];
NSLog(@"*********%@",presence.type);}
but - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message{}
is not calling in background I have also enable enableBackgroundingOnSocket. But i need to know that why it is not working in background . and if Apple reject this App because of VOIP is there alternative solution for that without push notification .
Any guidance or suggestion will be helpful.