Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working In Background Mode in XMPP

Tags:

I am Working On XMPP. I want to get notification in background mode. And I implement this things also ,

- (void)xmppStream:(XMPPStream *)sender socketWillConnect:(GCDAsyncSocket *)socket
{
    // Tell the socket to stay around if the app goes to the background (only works on apps with the VoIP background flag set)
    [socket performBlock:^{
        [socket enableBackgroundingOnSocket];
    }];
}

in my code i set VOIP flag in background modes of app plist file. In this mode my app can run in the background completely. But apple reject that way.

So. i think other way is APNS(Push Notification) but In my app huge chatting users then how can handle messges using Push Notification ?

And one more thing can i set silent audio file play in background mode and set background mode working ? in this way any problem or regection problem from apple side ?

So, Give Me some proper idea and suggestion For this Question.

Thank x in Advance.

like image 359
ramesh bhuja Avatar asked Apr 13 '16 05:04

ramesh bhuja


1 Answers

And one more thing can i set silent audio file play in background mode and set background mode working ? in this way any problem or rejection problem from apple side ?

This way Apple is rejecting App.

To notify use about the received message you have to use local notification for background and foreground state of App and use push notification for not running state of App.

To achieve your purpose use any background mode is not the solution.

like image 167
Payal Maniyar Avatar answered Oct 03 '22 10:10

Payal Maniyar