I built an app that streams a music library song from one iOS device to another. The app works great on any device when I run it through Xcode. However, when I run the the app through TestFlight, less that a second of audio plays, then it goes silent. I was wondering what could be causing this problem.
I tested unaltered code on the same devices. It worked through Xcode, and it didn't through TestFlight.
More detail about how my code works:
I use an AVAssetExportSession to export the song to a local URL, which I use to initialize an NSData object. I send the data object over bluetooth in packets using the GameKit framework.
I receive the data, again using GameKit, and parse it using Audio Stream Services. I then buffer and play it using Audio Queue Services. These are both under the Audio Toolbox framework.
Any help would be greatly appreciated!
EDIT:
So I tried the "old fashioned way" of opening the IPA file in iTunes and syncing it to the device. This works fine. So distribution through an iTunes sync works, while distribution through TestFlight doesn't.
Try to do the following steps:
Settings -> Safari -> Delete cookies and data
Settings -> General -> Profiles -> delete them all
Delete your old app
Create a new build in test flight
install from testflight
run app, see what happens, and look in the device console and logs
If that won't help try a different stream URL and see if it happens there too
p.s. I encountered some problems with testflight where an old NSUserDefaults data was redownloaded to a device. Wierd but happened.