doujian3132 2017-09-19 18:12
浏览 58

我可以通过Mac App Store应用程序提交Go程序吗?

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!

  • 写回答

1条回答 默认 最新

  • dongmei9203 2017-09-22 08:24
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多