I am looking into creating a Xamarin.iOS app that can connect to a WebSocket server when the app is backgrounded or suspended. The app is expected to close the channel once it receives a certain 'close' message from the server.
As per Apple's documentation, NSUrlSession allows to create a WebSocket task for the provided URL.
Xamarin has a short guide about using NSUrlSession, but the API reference documentation does not have any WebSocket-related methods.
A search engine search for 'xamarin nsurlsession webSocketTaskWithURL' returns zero results.
Is it possible to use WebSocket in NSUrlSession in Xamarin.iOS?
Update 1:
Visual Studio does not know anything neither about NSUrlSessionWebSocketTask
nor about .CreateWebSocketTask
:
(Microsoft Visual Studio Community 2017, version 15.9.25, Xamarin iOS 12.4.0.64)