Switch tasks in ios device,the oF app will restart?

When i open an OF app in ios device,and switch task and use other program.Switch back to the OF program,it will restart.

How can i solve this problem and make it like other apps?

Check your project’s ofxiOS-Info.plist file and change the value of “Application does not run in background” from YES to NO

1 Like

@stc Thanks stc :smile_cat: that helps a lot !

I have another question about ios. if i open another musicApp like “AppleMusic”,and playing a song.then i switch to my OF app。That the song will stop playing.Is there any setting i can do in the ofxiOS-Info.plist .Then i can still keep the song playing in background. I check it in plist but can’t find anything?

I’m not that experienced in multitasking but it seems if your app doesn’t use sound, then the other app’s sound in the background will continue playing (if it supports audio background mode capability). If you are using sound within your app, then its soundstream gets priority once it gets into focus and the other app’s sound will be toggled on a system level, according to official iOS dev docs, under Playing and Recording Background Audio: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

However you can change this behaviour according to the Audio Session Programming Guide https://developer.apple.com/library/ios/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007875