IOS AIR app still running when the iphone is locked? - ios

I just made a simple game with flash professional 6.0 and the adobe AIR 4.4 SDK for iPhone.
The problem is that when I lock the iphone pressing the power button, the screen switches off as usual, but the music of the game still sounds. If I exit the game pressing the home button it exits fine. Is only when locking the phone with the app opened.

Try add listeners for the events Event.DEACTIVATE on your main class and Event.EXITING on NativeApplication.nativeApplication.
On the events handlers you can do what you want to stop / pause your game.
Add a listener to the event Event.ACTIVATE on the main class to resume the game.

Related

Detect when App is Slide Over on top of running app on iPad

We have a WebRTC Swift 4.2 application using Google's native WebRTC code. We are having issues with Apple's App Slide Over Multitasking feature on iPads.
Issue:
What we are seeing is when our Application is running in a video call on an iPad as soon as another app is 'Slide Over' our app, our application stops using the video camera and microphone until the Slide Over app is closed. Once closed our application gets the microphone and camera back.
Expected Result:
Our application is still able to use the camera and microphone and the user is able to use both apps at the same time.
Questions:
Is there a setting we need to turn on to disallow Slide Over apps? If not is there a event we can subscribe to when the slide over happens so we can request camera and microphone access again?
What we have done:
We have set our application to require full screen in the project settings.
We have tried subscribing to the following events on the AppDelegate:
applicationDidEnterBackground, applicationWillResignActive, applicationDidBecomeActive. These events do fire once for the initial Slide over app open and close but not after consecutive Slide Overs with same app.
Turning on all Background mode capabilities. Has no effect.
On our ViewController.swift we have tried to subscribe to viewWillLayoutSubviews event. This event does not fire for apps opened with Slide Over.
Versions:
iOS 11.4.1
Swift 4.2
Xcode 10.1
I filed a bug report with Apple and they said,
"This sounds like expected behavior, given that only one foreground app is allowed at a time."

libGDX iOS home button kills the game

I'm developing a libGDX game for Android and iOS (MobiDevelop's RoboVM fork). Android works perfectly, but I have a issue on iOS. When the iPhone home button is pressed to leave the game, and I launch the game again by tapping on icon, the game does not resume from where it was paused, but instead restarts, which means the loading screen is displayed, all assets are reloaded, and the main menu appears. Like a fresh/new start of the app. I do not have any specific configuration for the iOS module in my libgdx project and am using what was pregenerated.
Is it possible to tell iOS that I do not want to kill the process? I want to switch to pause/sleeping mode only.
I found a reason of this problem. I tested it on the real device, therefore I was unable to see a logs. When I switch to simulator and look at the logs, I found a NullPointerException. This was a cause of application crash. When I fix this bug, everything works as I expected. After iPhone home button is pressed, pause() method of com.badlogic.gdx.Screen is called and after rerun the game, it continues from exactly where it stops / pauses.
I learned a lesson: make a tests on simulator at first :-)
While I am entirely unfamiliar with libGDX, I can tell you that except for a few very specific cases (VOIP etc.), you cannot control what iOS does with your app when the home button gets pressed.
Furthermore, it is the responsibility of the developer to save the app's state when the app leaves the foreground since this is not something that is or can be handled automatically in a performant way.

Background music ducked when Unity3D game is launched

I'm developing a casual game for iOS with the Unity3D engine.
Whenever my game is launched, the background music being played on the device (e.g.: Spotify, iTunes, etc.) is ducked. This is undesired because my game does not have any fancy sound effects, I' like to allow my players to keep listening to their music in the 'normal' volume.
For testing purposes I created an empty project in Unity3D, ensuring the Override iPad Music setting is unchecked in the iOS Build Settings. This is enough to reproduce the audio ducking issue.
INFO:
Unity 5.4.x (also occurs with Unity 5.3.x)
Xcode 8
iOS 9 and iOS 10
Does anyone know how disable Unity3D's default audio ducking?
Add an Audio mixer to the output of your audio source. On the Audio mixer in the project tab, click the drop down then click on master. Finally increase the attenuation volume to a level your feel satisfied with. Then you are good to go.

App Interruption - Siri Fails To Hear Human Voice

In my team's iOS app we have a bug when Siri is invoked while our app is running. Siri pops up and the waveform is shown very briefly and appears not to detect one's voice as the waveform remains very flat. Quickly thereafter it begins to list the things you can ask Siri.
We are using Xcode 6.3, tested on an iPad Mini with iOS 8.3 as well as an iPhone 5 with iOS 8.3.
The app never uses the microphone or queries any of the device audio inputs so I can't see this problem attributed to our app using the microphone directly. It does play looping ambient music and has sound effects.
Is there anything specific we should be calling an an interruption to ensure that Siri will work properly? Has anyone experienced similar issues?
This is most likely not related to your app. The iOS SDK doesn't provide a Siri API that could lead to this kind of events.
You may try to pause any ambient music/sounds effects whenever the app goes in background. (in AppDelegate.m)

How to disable iPod Music Control when device screen is locked?

I'm using MPMusicPlayerController in my app and it works fine in background.
The problem is I don't want user to control the song via iPod music app while device is locked?
Thank you for any helps.
I don't have knowledge in ipod.
As on IOS, You should detect when device goes sleep/lock mode. When the device goes lock/sleep, then u can control your music in sleep mode method function.

Resources