Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network requests do not work in Simulator #125

Closed
dcamenisch opened this issue Nov 12, 2023 · 3 comments
Closed

Network requests do not work in Simulator #125

dcamenisch opened this issue Nov 12, 2023 · 3 comments

Comments

@dcamenisch
Copy link
Contributor

dcamenisch commented Nov 12, 2023

Network requests do not seem to work in the Simulator and only on an actual device. The following code was used:

return try await trendingService.tvSeries(inTimeWindow: .week, page: page).results

The call never returns.

This behavior was observed with the newest version of TMDb (bb032f0) and iOS 17.0 (both on device and in the Simulator).

@dcamenisch
Copy link
Contributor Author

dcamenisch commented Nov 12, 2023

Seemed to be a issue related to the simulator. After reinstalling the app and restarting the simulator it worked.

However, after sometime it breaks again.

@yood
Copy link

yood commented Feb 7, 2024

I'm having the same issue, where the call never returns. Re-install in simulator fixed it, then it failed again soon after.

I think it might be due to multipathServiceType = .handover in the default client.

configuration.multipathServiceType = .handover

To use the .handover multiparth service type, you have to add the entitlement to Xcode.
https://developer.apple.com/documentation/foundation/nsurlsessionmultipathservicetype/nsurlsessionmultipathservicetypehandover

I added the entitlement, but the problem persisted.

I was finally able to fix it by passing in my own client with a URLSession with multipathServiceType left to the default.

Xcode 15.2
macOS 14.3

@movesmyers
Copy link

@yood can you clarify how you passed in your own client? I'm having this same issue and I'm having trouble with figuring out the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants