Stay connected to code-server even when Mac is asleep or I move away from the PWA on iPad - macos

VS Code has this new feature they’re rolling out where you can spin up a code server on your local machine. Essentially you just enter code-server into the terminal on Mac and you can connect via vscode.dev and you can add this URL as a Progressive Web App (PWA) to your iPad Home Screen.
My issues are:
Every time my Mac sleeps it shuts down the server
Every time I switch apps on my iPad I’m forced to reconnect
Is there any way to keep this server running even while my Mac is sleeping? Any way to maintain the connection even when I’m not in the web app?
I know this is a new product so any help is appreciated.

Related

Turn On macOS Screen Remotely

Is there a way to turn on the monitor remotely on macOS? I'm trying to write an app that will do this.
I've tried a couple of things but can't seem to find a way of triggering the screen to turn on after it has been turned off for power saving.
I've got a macOS app that advertises itself on the network via Bonjour. I can communicate to it via sockets, even when the computer is sleeping. However, I'm not sure what I can do from this macOS app that would trigger the screen to come on. I've tried sending a WoL packet and I've tried using Caffiene.
The macOS app doesn't need to pass Apple Review so I'm fine with using private APIs if necessary.

Xamarin Android 10 UDP Client In Background (Release Mode Only)

I am having an issue with the UDPClient in Android 10 (worked fine in Android 9) so Im assuming Im missing from Android 10 that I have yet to be able to find so far.
I have a UDPService (background service) running which is a pretty standard implementation (Port is 64200)
m_udpSocket = new UdpClient(m_port);
m_udpSocket.Client.ReceiveTimeout = (int)m_healthTimeout.TotalMilliseconds;
m_healthSocket.Client.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, (int)m_healthTimeout.TotalMilliseconds );
I wont post the sending and receiving code at this stage as I think its more permissions related.
The client periodically sends some UDP data to the server for processing. Its all local network based (not internet) and the data is sent via the WiFi on the device.
In Android 9, it all works as expected with the app in the foreground or the background.
In Android 10, it works perfectly when the app is in the foreground, but when the app goes to the background, when I try to issue the send on the socket
System.Net.Sockets.SocketException (0x80004005): Access denied
This error only happens in release mode on Android 10. If Im running in Debug Mode attached to the device, I can put the app into the background and the UDP traffic works as expected.
Based on all the above, Im assuming there is something else I need to do to allow the socket to work in the background in release mode but I cant seem to put my finger on what it is. Ive read about INTERNET permission and how Debug mode automatically adds this so is there something else I may be missing in the Android Manifest that could cause this.
Any help would be greatly appreciated.
Thanks in advance.
For anyone experiencing similar problems, in the end it had nothing to do with the actual code, but it was the Battery Optimisation Settings in Android.
Once I removed the app from the automatic battery optimisations, everything worked as expected.

Xamarin.IOS And Signalr Push Notification

I'm Developing A Xamarin App, I Create A Signalr Notification System That Work Fine In Both Xamarin.Android And Xamarin.IOS But It doesn't work when Xamarin.IOS App close.
Is There a way to fix this without using APN Or FCM?
Is There Way to IOS Let My app Do something even When App is Closed?
It is not possible to keep the signalr connection alive while in the background on iOS. The operating system will kill it, there is nothing you can do to stop that from happening. iOS immediately kills the app (you have 5 seconds) when going into the background, with a few exceptions.
If you are using android, you can create a foreground service to keep the signalr connection alive. Without a foreground service, android will also kill the signalr connection after a while. Android will allow a background app to run for a period of time, then will kill it, so you must have a foreground service to keep signalr connection alive.
Also be aware while in debug, iOS will allow apps to run in the background. But the released version will not allow apps to run in the background. This can make debugging signalr difficult, as it will work in debug, but not in the production version.
You will probably need to use APN for notifications. Be aware that APN requires a HTTP/2 back end server if you want to send the push notifications directly to Apples servers. Or you can use FCM to send APN.

how to open a local web project in ios simulator in Visual Studio?

Let say I have an angular project on local, separating back-end and front-end. After starting my BE, I am able to consume my front-end accessing http://localhost:4200/ in browser.
If both my BE and FE have been started, is there a way to access http://localhost:4200/ or http://[myipaddress]:4200/ in an iOS simulator safari, so that I can see my staging result in the simulator?
I know Chrome and any other browser is able to simulate mobile devices in device mode, unfortunately, there are results in a real device that are different than that in device mode. Thus I really want to find a way to see the bug fixing result in an iOS simulator without deploying to production.
I tried to set inbound rule for port 4200 and accessed http://[myipaddress]:4200 in safari in a simulator , it said 'Safari could not open the page because the server stopped responding'. (myipaddress = IPv4 Address in ipconfig).
Any hints?
You may have something in your specific setup stopping you from doing so, but you could just use the simulator included with Xcode, which should have no issues connecting to your localhost address on a given port.

Sphero Windows Sample App?

Has anyone gotten the Sample BasicDriveApp App working in Windows 8?
https://github.com/orbotix/Sphero-Win-SDK
When I build and run the Project I get a message "No Sphero is connected" and when I try to connect the Sphero via Windows 8 Bluetooth it does not work.
Can anyone offer any tips?
Thanks.
John.
It indeed works, I've had some problems with connectivity myself, however.. process I use to restore if all goes awry:
Refresh Sphero (return to base for sleep mode, wait a few seconds, wake up)
Refresh Bluetooth in Windows (off / on) without connecting to Sphero
Open your app, wait for it to connect. It'll find Sphero and automatically dig in if all goes well.
[Update]
It appears Windows 8.1 doesn't really know what to do with Sphero. It has a hard time reconnecting after the connection is lost, even if you close all instances of the app and toggle through Bluetooth.

Resources