Comments (7)
As of 5.0.0, we have two methods for auto-launching on Mac;
- Using AppleScript to tell System Events to add a Login Item for the app.
- Adding a file-based Launch Agent; i.e. adding a
.plist
to the user'sLibrary/LaunchAgents
directory.
Neither of these will be accepted in the MAS. I'm 99% sure about number 1, just because I haven't tried to get it into the app store.
Number 2 reaches outside the app sandbox.
It seems like a tricky problem even if you were writing a completely native app. So is it possible at all to have an auto-launching app in the app store? Yes, according to Modern Login Items. Your app would need to not be auto-launching by default, there would have to be a setting for the user to toggle it on or off, and you need a Launch Agent. The Launch Agent needs to be a separate app/executable with special permissions (and needs to be signed like your main app).
Since it needs custom native code and it needs to be signed, that's not something that will be added to this module.
It makes more sense to either create this manually yourself, or if it was added to nw-builder, electron-builder (see electron-userland/electron-builder#756), etc.
Even if you have this extra (signed) app, that might not be enough as Modern Login Items tells us it needs to contain a "user preference". I don't think there is any way you could toggle this user preference aside from programmatically with native code. This leads me to think that NW.js and Electron would need to expose an API for this with native code underneath which toggles the preference.
Or (which just popped into my head...) maybe it's possible to toggle it with a custom native module. I'm not sure.
I created this module for future reference and assume we won't make much progress on it, but if you have an idea or can help, feel free to reply below.
from node-auto-launch.
@transitorykris we'd love to support this but I'm not sure how. The above comment and links sum up everything we know on the subject. We're open to suggestions.
from node-auto-launch.
This was marked closed and marked as invalid. Is this not a concern for the project, or is there a work around elsewhere (I'm guessing no since the readme says explicitly the app is likely to be rejected).
from node-auto-launch.
seems like electron has find a way to MAS friendly auto-start option for MAC. see here https://electron.atom.io/docs/api/app/#appsetloginitemsettingssettings-macos-windows
from node-auto-launch.
@JerryGoyal
Note: This API has no effect on MAS builds.
I interpret that as: this API does nothing when used in MAS builds.
from node-auto-launch.
This appears to be possible in the latest 2.x betas?
https://github.com/electron/electron/blob/v2.0.0-beta.2/docs/api/app.md#appsetloginitemsettingssettings-macos-windows
from node-auto-launch.
Changes appear to have been added here electron/electron@8184cbf#diff-c0db39733aba3af6dedd3c8a42082f92
from node-auto-launch.
Related Issues (20)
- Windows cannot auto launch after application's install path changed. HOT 3
- There is no option to enable auto launch for all users HOT 1
- Auto-launch with electron-winstaller
- ProcessUncleanExitError appearing in console HOT 1
- Be more flexible on path value: must be absolute if not Windows Store target HOT 19
- IsHidden don't work on Linux?
- background app permission
- Share your code
- Run on startup on Windows10 with administrator privileges HOT 4
- Remove Login Item from settings on application uninstall (Mac)
- How to use `opts`? HOT 2
- AppImage : Default path detection doesn't work properly because it uses mount path HOT 5
- Linux desktop entry file is named based on `path`, not `name` HOT 2
- Why the name I pass to AutoLaunch constructor is not be used? HOT 4
- Check if app launched as hidden at login or manually by the user HOT 13
- Error with Electron-Webpack 4.28.4 HOT 2
- AppleScript security issues on macOS Mojave HOT 3
- Add Ethereum name or address to package.json
- Open two Window (my App and Electron documencation window) HOT 5
- Invalid .desktop file is created if path contains spaces on Linux HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-auto-launch.