Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make this Mac App Store compatible #43

Closed
adam-lynch opened this issue Sep 17, 2016 · 7 comments
Closed

Make this Mac App Store compatible #43

adam-lynch opened this issue Sep 17, 2016 · 7 comments

Comments

@adam-lynch
Copy link
Contributor

If someone uses this module in their app (e.g. NW.js or Electron app), it should not cause the app to be rejected.

@adam-lynch
Copy link
Contributor Author

As of 5.0.0, we have two methods for auto-launching on Mac;

  1. Using AppleScript to tell System Events to add a Login Item for the app.
  2. Adding a file-based Launch Agent; i.e. adding a .plist to the user's Library/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.

App sandbox diagram

App sandbox allowed directories


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.

@transitorykris
Copy link

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).

@adam-lynch
Copy link
Contributor Author

@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.

@GorvGoyl
Copy link

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

@adam-lynch
Copy link
Contributor Author

@JerryGoyal

Note: This API has no effect on MAS builds.

I interpret that as: this API does nothing when used in MAS builds.

@beaur
Copy link

beaur commented Mar 6, 2018

@beaur
Copy link

beaur commented Mar 6, 2018

Changes appear to have been added here electron/electron@8184cbf#diff-c0db39733aba3af6dedd3c8a42082f92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@beaur @transitorykris @adam-lynch @GorvGoyl and others