An error occurred on the xpc connection to setup the background session

Viewed 1243

I have problem when try to call request to API. It say:

"An error occurred on the xpc connection to setup the background session: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.nsurlsessiond" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.nsurlsessiond}"

But this error only appear in iOS 13, and run normally in iOS 12 also in iOS 11. Anyone know the solution?

2 Answers

I think this is bug on ios emulator, because when i play on device everything is work.

Update: For Emulator, you need to add provisioning profile. If you already add it but still not work, select the wildcard option not the automatic option.

If working on the iOS Simulator, you need to indicate that your project needs to use the Entitlements.plist file.

Go to your iOS project file. Go to Build -> iOS Bundle Signing. Here you can select your Entitlements.plist file as Custom Entitlements (make sure to select the desired Configuration (e.g. Debug) and Platform (iPhoneSimulator) in the top of the screen.

Related