Background Modes in iOS Tutorial

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

Background Modes in iOS Tutorial

Postby rwenderlich » Thu May 02, 2013 11:00 am

This is the official thread to discuss the following blog post: Background Modes in iOS Tutorial
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2142
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 332 times

Re: Background Modes in iOS Tutorial

Postby northy179 » Thu May 02, 2013 10:24 pm

Great topic and worthy advice. Thanks!

I am curious though why you left in a deprecated method in the location services section? I think enough users are now on iOS6 that we can let it go :P
Check out my apps, services and tutorials here: http://northysoftware.com
Learning Swift? Kick start the flow of knowledge by subscribing to the Swift Coder weekly newsletter: http://swift-coder.info
User avatar
northy179
Team Member
iOS Tutorial Team Member
 
Posts: 883
Joined: Sun Jun 10, 2012 11:19 pm
Location: Australia
Has thanked: 19 times
Been thanked: 157 times

Re: Background Modes in iOS Tutorial

Postby shippo0708 » Fri May 03, 2013 2:34 am

northy179 wrote:Great topic and worthy advice. Thanks!

I am curious though why you left in a deprecated method in the location services section? I think enough users are now on iOS6 that we can let it go :P


Why are you so eager to kill off old stuff :P
User avatar
shippo0708
Uber Haxx0r
 
Posts: 679
Joined: Fri Apr 15, 2011 4:06 am
Location: Texas
Has thanked: 2 times
Been thanked: 51 times

Re: Background Modes in iOS Tutorial

Postby sikaka425 » Fri May 03, 2013 9:15 am

Nice article! I like that it goes through most modes with concise examples.

The thing I'm missing is that CoreBluetooth introduced two new modes: bluetooth-central and bluetooth-peripheral. These are vital for BLE development. I understand that these worth their own post or even series but at least it would be useful to mention them in the list of modes for the sake of completeness.

Great work!
sikaka425
n00b
 
Posts: 1
Joined: Fri May 03, 2013 9:02 am
Has thanked: 0 time
Been thanked: 0 time

Re: Background Modes in iOS Tutorial

Postby chinjazz » Sat May 04, 2013 8:21 am

Great Tutorial Gustavo!

I wondered about this subject a number of times in the past.

Thanks, Adam
User avatar
chinjazz
Hacker
 
Posts: 26
Joined: Sat Mar 26, 2011 2:15 am
Has thanked: 3 times
Been thanked: 0 time

Re: Background Modes in iOS Tutorial

Postby shippo0708 » Sat May 04, 2013 8:10 pm

sikaka425 wrote:Im not sure anyone here wants to touch bluetooth related stuff... Apple makes it so damned hard since they have to have that chip just to connect to the phone (or be a speaker)

Ah, but Bluetooth LE is different. It allows for much more cool stuff. :-)

For example, check out this video: http://vimeo.com/channels/melbournecocoaheads/59765638
User avatar
shippo0708
Uber Haxx0r
 
Posts: 679
Joined: Fri Apr 15, 2011 4:06 am
Location: Texas
Has thanked: 2 times
Been thanked: 51 times

Re: Background Modes in iOS Tutorial

Postby Maikel » Tue May 07, 2013 8:40 am

Great post like any other from this site!! I was looking forward this stuff long ago!

I have a simple question about VoIP. I was struggling to achieve long (and continuous) background execution time.
But with Voip, i have the handler(in setKeepAliveTimeout) which gives me only 10 seconds every 600.Yes! just 10 s :( .
Also the 600 s from beginbackgroundtaskwithexpirationhandler and 60 after the background task expires.
And 10 s every time the stream received any kind of data from the server.

I have tried the location manager trick, when expiration is about to reach the end you switch gps on and when didupdatelocation is called u obtain 600 s again, then switch gps off and so on...) but battery (iPhone's best friend) doesn't like.

I would appreciate any kind of help.
Thanks!
(Of course this is not to submit to Apple Store :mrgreen: )
User avatar
Maikel
n00b
 
Posts: 4
Joined: Fri Nov 09, 2012 10:43 am
Has thanked: 1 time
Been thanked: 0 time

Re: Background Modes in iOS Tutorial

Postby blakninja » Thu Jun 06, 2013 6:53 pm

The VOiP method doesn't work. Even with your sample, when I go to background mode and type in "ping" in the terminal, I don't get a "pong" back.

Can you check..
blakninja
Hacker
 
Posts: 25
Joined: Sun Jan 08, 2012 7:40 pm
Has thanked: 0 time
Been thanked: 1 time

How to automatically track user location when they reboot?

Postby codyfy » Thu Jul 04, 2013 11:03 pm

Hi!

Excellent tutorial. I see how it keeps tracking the user's location even after they press the 'home' button and exit the app; however, I'm trying to track the users location even if they reboot the device. Is there a way to register my app for location changes even if the app hasn't been launched? I know using Voip may technically work, but Apple would reject. What about subscribing to significant changes or a geo-fence to trigger the application to come back to life and track granular movements?

The app essentially needs to track the users GPS location at regular intervals - 24/7.

Thanks!
codyfy
n00b
 
Posts: 3
Joined: Wed Jan 04, 2012 7:08 am
Has thanked: 0 time
Been thanked: 0 time

Postby jackyccaa » Fri Jul 05, 2013 9:53 pm

As to AVQueuePlayer, we can use addPeriodicTimeObserverForInterval to make it run in background.
However, when talking about recording voice in background (AVAudioRecorder), how can I do it?

Thanks so much
jackyccaa
n00b
 
Posts: 1
Joined: Fri Jul 05, 2013 9:49 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests