App in background

91 views
Skip to first unread message

David Shaikh

unread,
Feb 7, 2012, 6:59:35 AM2/7/12
to xmppfr...@googlegroups.com
Hello guys,

I developed and app that is currently set as "Location based" so that it can run in the background indefenitely. It's not a trick i need it to do stuff when the user moves.
After some search I learned that this app will only execute code on the event of a location change, no timer whatsoever will be able to execute any code after 10 mins.

My app, while in the background, stays connected to XMPP for 3 hours or so, it then disconnects. I would like the app to never disconnect, I looked at the framework but I can't find the place where to fix this behaviour. Do you know if it's possible to stay connected "indefinetly"?

Thanks

David Shaikh

unread,
Feb 7, 2012, 7:33:37 AM2/7/12
to xmppfr...@googlegroups.com
little edit, after 50 mins the app disconnects from the XMPPRooms it was logged in but doesnt disconnect from XMPP.

James Hays

unread,
Feb 7, 2012, 11:18:56 AM2/7/12
to xmppfr...@googlegroups.com
I had achieved this by setting the voip background flag and enabled background sockets on the xmppStream. That, along with setting a ping to the server using the UIApplication setKeepAliveTimeout and the built-in reconnect module, it seemed to stay connected just fine.

Now, with that said, the fact that I had the voip background flag set caused my app to be rejected from the store so I've since then been unable to keep the connection very long after the user closes the app.

So, that's how I got it to work, but if you have a secret to getting it through the app store, I'm all ears. :)

> --
> You received this message because you are subscribed to the Google Groups "XMPPFramework" group.
> To post to this group, send email to xmppfr...@googlegroups.com.
> To unsubscribe from this group, send email to xmppframewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xmppframework?hl=en.

fvisticot

unread,
Feb 9, 2012, 12:56:19 PM2/9/12
to XMPPFramework
+1
I think it is not possible without the voip flag...
How are doing other IM applications (IM+) ?
Using notifications could be useful...

Fred

Eric Chamberlain

unread,
Feb 10, 2012, 12:03:51 PM2/10/12
to xmppfr...@googlegroups.com
There is no way to keep the app running in the background.  Apple does this so the radios are not on the whole time and drain the battery.  Apple does allow VoIP applications to wake the app when network traffic arrives, but they need to be VoIP applications and battery life suffers when the apps are active.


--
You received this message because you are subscribed to the Google Groups "XMPPFramework" group.
To post to this group, send email to xmppfr...@googlegroups.com.
To unsubscribe from this group, send email to xmppframewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xmppframework?hl=en.

--
Eric Chamberlain, Founder
RingFree Mobility Inc.

James Hays

unread,
Feb 10, 2012, 12:24:23 PM2/10/12
to xmppfr...@googlegroups.com
Have you found a best practice to create a good user experience that you'd be willing to share?

Eric Chamberlain

unread,
Feb 11, 2012, 2:37:01 PM2/11/12
to xmppfr...@googlegroups.com
Our app is a voip app, so we've gone that route.  Where I to do a chat centric app, I would use an intermediary server to send push notifications to the client when the app is in the background.

XMPP is pretty chatty and not designed for mobile.  Presently, there is no way to stay on-line, but turn off presence updates.  I've thought about modifying a BOSH implementation to use HTML for foreground communication and push for background, but I've not had the time nor need to pursue it.

Rico

unread,
Feb 13, 2012, 3:53:17 AM2/13/12
to xmppfr...@googlegroups.com
Dose VOIP app Must transport voice data? I thought message chatting is kind of it, but I'm not sure, and never make a try.

Hendrik M Halkow

unread,
Feb 13, 2012, 4:23:15 AM2/13/12
to xmppfr...@googlegroups.com

That's why it is called voice ;-)

Reply all
Reply to author
Forward
0 new messages