Turning on Bluetooth from macOS app

Can an app for macOS build in such a way that an option can be given for the user to turn on the bluetooth from the app itself without redirecting the user to the bluetooth system preferences? Like the AirDrop in mac, there is option 'Turn Bluetooth on" which on clicking turns on. the bluetooth without going to bluetooth system preferences. i want to know if the same can be done in a custom build app, or the only way is to redirect the user to bluetooth system preferences.

Please help.