Call this first. If you don't, your service will not work.
The callback's receivePort will receive the message 'stop' when the service is to be stopped.
It should send 'stopped' via its sendPort once the work is finished.
It can also send 'not stopped' in order to keep working.
If it does not do so within 5 seconds, the service will be stopped forcefully
This method sends data to the background isolate
If you want to send data from the background isolate to the UI isolate, please see the included example app
This sets a boolean via SharedPreferences whether or not to start the service on device boot.
The value can be changed from the app using the key 'autostartOnBoot' via the SharedPreferences plugin.