Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed a mac app extension in an Electron app?

I'm trying to embed a Finder Sync extension written in Swift in my app written with Electron. How can I manage to make them work together and communicate with each other? I have read the Apple documentation but it only explains how to add a target to a native application. I also noticed that I can manually inject the .appex compiled file (produced by XCode) in the application Plugins folder using electron builder. How can I develop and test the extension in XCode and embed it correctly in a custom Electron app? Any suggestion?

Thank you very much for any suggestion

like image 665
Marco Moschettini Avatar asked Aug 10 '17 11:08

Marco Moschettini


People also ask

Does Apple allow Electron apps?

Sign Electron apps​ Electron apps can be distributed through Mac App Store or outside it. Each way requires different ways of signing and testing.

Can I build Electron app for Mac on Windows?

Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms.

How do you package an Electron app into a single executable?

It's impossible to create a single executable file of an electron application. The application's source code is available to anyone. No ways to protect the application's assets (scripts, images, etc.) No ways to set the executable file icon.

What is an Electron Mac app?

Electron is an open source framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It combines support for building and running applications cross platform on Mac, Windows, and Linux.


1 Answers

Create PlugIns folder in your Electron root folder.

Copy the .appex file into PlugIns folder.

If you are using electron-builder, modify the package.json file - add: "extraFiles": ["PlugIns/"] in the "mac" section.

Build. The Contents of your app package will contain the PlugIns folder and your appex file inside, and the appex will get loaded into your app's process.

like image 128
Tom Andraszek Avatar answered Oct 14 '22 05:10

Tom Andraszek