Search code examples
c#.netwebsocketwindows-phonewin-universal-app

Windows Universal App maintain open WebSocket


How to have a WebSocket open on Windows Universal App? Can I have my WebSocket to be open even when app is closed?


Solution

  • On a Windows Universal app? Yes. On a Windows Phone 8.1 app? No.

    A Windows Store app can use a ControlChannelTrigger to receive socket notifications in a background task even if the main app is suspended. This is demonstrated in the ControlChannelTrigger StreamWebSocket sample in the Windows Dev Center.

    ControlChannelTrigger is not supported in Windows Phone Store apps, but it is supported in Universal Windows 10 apps on mobile devices.