[iOS] Do not use the background check in the iOS handler. #2555
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The iOS NSUrlSessionHandler needed to use a workaround to ensure that
Http requests that were performed by the application did not end up in a
stale situation in which the completion would never be reached. This was
due to xamarin/xamarin-macios#5463
This workound will listen to the UIApplication notifications and would
cancel all the inflight requests. For reference, this happens here:
https://github.com/xamarin/xamarin-macios/blob/main/src/Foundation/NSUrlSessionHandler.cs#L174
As you can see, if we set the property to false, we will get the
notification. This is not longer needed as mono fixed the runtime
issue. The Xamairn.iOS team skips that workaround by default as per
this commit:
xamarin/xamarin-macios@b6fbae5#diff-1e7e2b8b4f4fe98a485a36c085a0e9cb94f53fa87a3ff11c7c54682cc3b9d514
This library should not be using the workaround because it will have
undesired side effects on applications because they will have
cancelation exceptions that are not expected AND the library does not
provide an API to reuse the HttpClient instance configured by the
client.