URLSession.dataTask not working on testflight

I have created an app that allows access to a url using URLSession and it is working correctly when I launch the app using XCode, but it does not work when I submit the app for testing in testfligh. It seems that something is blocking requests made from URLSession. Is it possible that there is some configuration that you are not taking into account for publishing to testflight

Answered by DTS Engineer in 789872022

Is this on macOS? Or iOS? Or one of iOS’s ‘children’?

This matters because macOS is the only platform where it’s possible that deploying via TestFlight might trigger a problem like this. Specifically, TestFlight assumes Mac App Store which requires the App Sandbox, and a sandboxed app’s access to the network is controlled by entitlements.

On other platforms — and, frankly, this is the most like cause on macOS as well — it’s likely that TestFlight isn’t the cause, but instead you have a Debug / Release build configuration.

Fortunately, there’s a good way to tell these apart. See Isolating Code Signing Problems from Build Problems.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Is this on macOS? Or iOS? Or one of iOS’s ‘children’?

This matters because macOS is the only platform where it’s possible that deploying via TestFlight might trigger a problem like this. Specifically, TestFlight assumes Mac App Store which requires the App Sandbox, and a sandboxed app’s access to the network is controlled by entitlements.

On other platforms — and, frankly, this is the most like cause on macOS as well — it’s likely that TestFlight isn’t the cause, but instead you have a Debug / Release build configuration.

Fortunately, there’s a good way to tell these apart. See Isolating Code Signing Problems from Build Problems.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks Eskimo, I found the problem. The behaveour in xCode and in TestFlight is diferent.

URLSession.dataTask not working on testflight
 
 
Q