Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I submit a Go program with a Mac App Store app?

I'm trying to plan a product I'd like to build and release on the Mac App Store.

I have a lot of functionality in a Go program that I'd like to use from an Electron app, ideally I would like to use gRPC to interface between them. I'm concerned that this will be rejected by the app review process, can anyone tell me:

  1. Is it allowable to have your main app 'call' a bundled Go program?
  2. If it is, would I be limited to stdin/stdout (I'm concerned that to use gRPC my Go Program would have to run at startup and that may not be allowed)?

I've tried to establish the answers to the above by reading this https://developer.apple.com/app-store/review/guidelines/ but without experience which hopefully some of you have I can't be sure. I'd like to avoid investing a lot of time building it a way that will be rejected.

Edit/Update:

An update - Doing some further research and thinking, I have re-read this part of the App Store review guidelines "2.4.5 (iii) They may not auto-launch or have other code run automatically at startup or login without consent nor spawn processes that continue to run without consent after a user has quit the app.".

  • Looking at it, the "other code" I would run would have consent (as part of the app bundle structure/package) and I would engineer it so that it would shut when the user quits the app.

I also found that an applications Xcode bundle structure has this comment about the 'MacOS' directory: "MacOS (Required) Contains the application’s standalone executable code. Typically, this directory contains only one binary file with your application’s main entry point and statically linked code. However, you may put other standalone executables (such as command-line tools) in this directory as well."

  • So, it looks like my question part 1 is answered but I am still unclear on part 2 of my question.

Edit/Update 2:

In the app sandboxing entitlement guide I have found this "To enable your app to connect to a server process running on another machine (or on the same machine), enable outgoing network connections. To enable opening a network listening socket so that other computers can connect to your app, allow incoming network connections."

This implies I could use TCP/gRPC but isn't definitive... I'll continue to chase a definitive answer!

like image 964
bunoi Avatar asked Oct 29 '22 01:10

bunoi


1 Answers

Yes. There is no reason you cannot submit an app that uses go code - see the ivy calculator on the ios app store (which has even stricter rules than the mac app store):

https://itunes.apple.com/us/app/ivy-big-number-calculator/id1012116478?mt=8

So it doesn't have to be a separate binary, you could use cgo for example to call Go code using C bindings. Here is a list of x-platform UI libraries for Go, some of which use electron.

https://github.com/avelino/awesome-go#gui

You can also use a separate command line tool within the app that you spawn for specific operations, as long as it doesn't continue running after the app is closed. Many apps on OS X wrap command line tools, so your tool could be in go and then the app just call it.

What you're not allowed to do is change code after submission, or run background processes separate from the app which don't close when it does.

Or you could make the bulk of your app resident on a server (written in go), and have the app(s) query that server for responses - this would let you keep most code in Go while serving various platforms with a thin wrapper on each platform (for example mac os, ios, android) - this might be worth considering if you think it would be viable, as it lets you do the bulk of the work in go, and keep your app updated easily for all platforms without having to go through the gatekeeper of the various app stores. If you're think of an electron app anyway, and the app relies on information from the web, it's a possibility.

It depends very much on the nature of your app and what it does which approach is most suitable, but the approach you outline of bundling a go app should be fine.

like image 75
Kenny Grant Avatar answered Nov 12 '22 23:11

Kenny Grant