Background play stops when device has a passcode - xcode6

I need help. After using Xcode 6, the background play will stop after playing for 10 seconds when my iPhone is locked. This happens when the device has a passcode on iOS 7 and above. And I use the AVAudioPlayer. Does anyone know how to resolve this?
It works well if the device doesn't have a passcode.

Related

Native resolution on iPhone 6, works on simulator but not on device

I'm having some problems enabling native resolution on the iPhone 6 on the actual device itself, when I run in the simulator it runs at native 375x667 (verified by both launchscreen and nslog of viewcontroller size.
2015-04-29 13:24:24.220 aqrew_ios[7851:1294675] ViewController:didLayoutSubviews() - Width=375.000000 Height=667.000000
However when I run the same code on an actual iPhone 6 (iOS8.3) its running at scaled iPhone 5 resolution.
2015-04-29 13:17:02.614 aqrew_ios[720:179633] ViewController:didLayoutSubviews() - Width=320.000000 Height=568.000000
I've been through the SO How to enable native resoltuion and have the following in the LaunchImage assets setup and working, app is portrait only, iphone only:
Launchimage screenshot
AppIcons are:
AppIcon screenshots
(I'm not allowed to post images as on this account (work) I dont have 10 rep points!)
However whilst it works perfectly on the iOS simulator its not working on the real device, would appreciate any ideas....
Thanks
If you go into the device settings app, in the 'display & brightness' section there is a setting called 'display zoom' which can be set to standard or zoomed. When zoom is enabled an iPhone 6+ scales up an iPhone 6 sized window, and an iPhone 6 zooms up an iphone 5 sized one.
(This caused me some stressful hours a couple months ago)

iBeacon detection wake up iPhone from sleep mode with UILocalNotification

My application run on iOS 8 and when it go into background it need to detect and show a notification to the user when iBeacon detected (with UILocalNotification).
All works fine but when the iPhone is sleep/locked the Notification doesn't wake up the device.
How can I wake up the device when a notification come in?
Make sure the phone is detecting the beacon at all. Try adding a NSLog statement inside the didEnterRegion method or wherever you launch the notification. Then, start looking at the debug console while the phone screen is off and turn on the beacon. Do you get a debug line?
If you do not see the debug line, the issue is with detection, not with the notification. Note that it can take up to 15 minutes on an iPhone 4S to detect a beacon.
If this does not help, please post your code that sets up region monitoring and sends the notification. Also, please, describe how you are testing entering and exiting the region.

Background Location Services after reboot in iOS 7

I'm interested in a border line iPhone app able to detect the user location continuosly.
The app will be delivered in enterprise mode (so no Apple approval).
Basically it should run forever (resetting the backgroundTimeRemaining through the location service start end stop).
the issue that I was not able to fix is to relaunch the app after a reboot, event if I declare the voip capability, it seems that the system give me only 3 minutes, no more time despite all the workarounds.
so actually I'd like to know if someone was able to implement this sort of behaviour on iOS7.
thanks in advances, please find below some references.
iPhone - Backgrounding to poll for events
to run app continuously in the background
Background Location Services not working in iOS 7
Start Location Manager in iOS 7 from background task
ok, I got it.
the music hack is the solution.
During the further 180s of background time a small mute playback of few seconds (of local mp3) restart the backgroundTimeRemaining counter.
bye

how to keep ios app using opentok video chat in foreground

I've integrated opentok ios sdk in my iOS 7 app, it is working fine, except this problem:
During video chat if I don't access iPhone for 5-10 seconds..then my app moves into background, causing viewer at other end to hear only audio. Video is disabled after app goes to background state.
I've observed same thing with their official example
https://github.com/opentok/opentok-ios-sdk/tree/master/samples/OpenTokFullTutorial
How can I avoid my app going to background while video chat is ongoing. Skype is working fine in this case, I want to achieve same thing.
What you want to do is prevent the iPhone from going to sleep. To do this, you cant try this:
[UIApplication sharedApplication].idleTimerDisabled = YES;
Here is iOS documentation on idleTimerDisabled
If you don't want the app going into background at all (like when the user taps on home button), you can opt to kill the app when it's not running instead of having it run in the background. To do that, check out iOS guide on opting out of background execution
If you do not want your app to run in the background at all, you can
explicitly opt out of background by adding the
UIApplicationExitsOnSuspend key (with the value YES) to your app’s
Info.plist file. When an app opts out, it cycles between the
not-running, inactive, and active states and never enters the
background or suspended states. When the user presses the Home button
to quit the app, the applicationWillTerminate: method of the app
delegate is called and the app has approximately 5 seconds to clean up
and exit before it is terminated and moved back to the not-running
state.
Hope that helped!

iOS Simulator in Xcode

I think that in my storyboard file in xcode that it has me using an iPhone 5 display, but when i load the simulator, i think it is an iPhone 4 display. So the view doesn't look the same. Does anyone know how to use an iPhone 5 display as my Simulator?
From the iOS simulator menu
Hardware -> Device -> iPhone (Retina 4-inch)
EDIT
The device looks like this
I guess you are right. For some reason they just don't have the actual visual presentation of the iPhone 5 in the simulator yet.. Hopefully they will soon though! that would be cool!