Avatar of HackThePlanet
HackThePlanet

asked on 

iOS backgrounding execution

Hi guys,

I am developing an iOS app for iPad/iPhone for sending XMPP messages. If the user enters an area with no network coverage I want to retry sending the message when I get network connectivity. I can do this, however if the user composes a message and then hit the Home button and i'm in a  the app obviously goes into the background.

I want to be a responsible app and get into the store so know I can't piggy back onto VOIP, Music background modes so how can I still send this message out while app not in the foreground.

Can iOS wake my app up even for a short time say 30 secs every xxx minutes to let me create my XMPP session and try sending the message again? Or can I create a finite task and try for as long as possible to send my message out. Once this time limit is reached thats it and I have to wait until the app is started again?

I know there are new bg modes in iOS 7 but I want to cater for iOS 6 as well ( don't ask :D ). Do I have to use one of these new bg states for creating a long running app?

There must be something that I can do. What is the correct and best solution. Hopefully not mutually exclusive :D.

Ideally it would be iOS waking me up every so often if I have messages and me trying to send them.

Help more than welcome.
iOS

Avatar of undefined
Last Comment
pgnatyuk
ASKER CERTIFIED SOLUTION
Avatar of pgnatyuk
pgnatyuk
Flag of Israel image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of HackThePlanet
HackThePlanet

ASKER

Since the application is in essence a chat application (XMPP chat) would that fall under a social networking application in Apple's eyes?

I see in the Location Manager section in developer section that it talks about "social networking".

If I have messages to send and I go into the background I suppose I could start a significant change location service. If I run past allotted time I could register for a stay of execution with a finite task.

And so on until all messages are sent. Then I would rely on Push notifications for notification of incoming messages.

Sound like a plan that would get into the app store for iOS6 and 7?
Avatar of pgnatyuk
pgnatyuk
Flag of Israel image

Sounds good.
Avatar of HackThePlanet

ASKER

Brilliant. Many thanks pgnatyuk. Found a way forward. Ciao!
Avatar of HackThePlanet

ASKER

Fab answer. Helped distill into something that is now understandable. Cheers!
Avatar of pgnatyuk
pgnatyuk
Flag of Israel image

You are welcome
iOS
iOS

iOS is a mobile operating system developed by Apple; it is a derivative of the Mac OS X desktop operating system, with which it shares many (but not all) common frameworks and other components. These include Cocoa Touch, the Mach/Darwin/XNU kernel and code from the Berkeley Software Distribution (BSD). Each iOS application runs in its own secure sandbox to prevent altering other applications, the operating system, or any other data.

4K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo