iOS app lost ability to run in background

MattHarringtonMattHarrington USMember, University

I have a published Xamarin.iOS app (https://tiny.cc/strumios) which no longer runs in the background. This began yesterday, and I have no idea why. It only happens on my iPhone 6, but does not happen on an iPad. Both devices are on iOS 9.3.1. It had been working fine before this.

The app plays streaming audio, and when placed in the background the app stops after 90 seconds. When I run it again, I see the app's launch screen. This leads me to believe the app is being terminated, not merely suspended.

Other audio apps continue to play in the background on this phone. Also, I have a similar Xamarin.Forms app which also plays audio in the background just fine. The Xamarin.Forms app uses the same audio code as the Xamarin.iOS app. Of course, my Info.plist is set correctly as it has been working fine until yesterday.

Restarting the iPhone and reinstalling the app did not help.

What could be going on?

Posts

  • rene_ruppertrene_ruppert DEXamarin Team, University, XamUProfessors Xamurai

    It's hard if not impossible to tell what's going on without having access to the source of the app.
    Random thoughts:

    • Did you rebuild with a new version of Forms/Xamarin.iOS/a different iOS SDK?
    • Did you upgrade your Xamarin installation (stable, beta, alpha)
    • Are there any errors in the device log (connect via USB, run Xcode, show Devices menu and access logs). Maybe there's a hint in there.
  • MattHarringtonMattHarrington USMember, University

    All fixed. The problem didn't have to do with background audio streaming at all.

    The real problem was that somehow my Azure backend settings changed, but not by me. It appears that sometime yesterday, my Azure Mobile App backend had authentication incorrectly enabled. I don't know how that could have happened, since I didn't even sign in to Azure yesterday.

    When users log into my app, a token is stored in the iOS Keychain. When the app is launched in the future, the Keychain is searched for a cached user. If one is found, the user is silently and automatically logged in. The login procedure involves talking to Azure. That's what started failing yesterday. 90 seconds after the login request, an exception is thrown and the app crashed.

    Xamarin.Insights was not notifying me of these crashes, so I didn't know they were happening. The Insights portal shows the crashes, but I received no emails.

    The reason it worked on my iPad was that I never logged into the app on that device. The app functions fine without logging in. So, there was no cached user and the app did not try connecting to the Azure service.

    I'll contact the Azure team to see how my App Service settings could have changed. I can only speculate at this point.

    Thanks for thinking about it.

Sign In or Register to comment.