I'm using phonegap to run my HTML/JS code in a native app for iOS. Is there any way to do this on the Mac for inclusion in the Mac App Store? Or just platform that allows me to run HTML/JS in a native app wrapper?

So far the only thing I've seen is phonegap-mac but I'm not entirely sure how to use it:

https://github.com/phonegap/phonegap-mac

有帮助吗?

解决方案

Phonegap-mac hasn't seen any work in a while. Perhaps try MacGap (https://github.com/maccman/macgap), which is a fork and is still being actively developed.

UPDATE 2014-03-18: MacGap hasn't seen a lot of work recently either.

For my latest HTML5 Mac App Store app, I used Cordova http://cordova.apache.org, as I think long term that is now the better solution.

There is a cordova-osx version which can generate a OSX project. It's no where near as complete as the iOS / Android cordova platforms, but it works - and is probably a better solution than MacGap if you're hoping to support both iOS + OSX. (having said that, MacGap probably works better "out of the box" currently).

Note that the Cordova CLI doesn't currently work with cordova-osx - you have to maintain the OSX X-Code project manually, which is a pity. As well, many of the Cordova plugins don't support OSX.

I had to do a fair bit of 'hacking' to get my app working on Cordova OSX. But at least I now have a HTML5 app which can run on Android / iOS / OSX which is pretty cool.

其他提示

UPDATE: Titanium Desktop has been renamed tidesdk http://www.tidesdk.org/ and looks really great. Gonna try it fast.

MacGap (https://github.com/maccman/macgap) should provide a great solution for you. It's under active development, and provides access to a range of OS X desktop-specific features such as:

  • menu items
  • dock badge
  • window positioning
  • Growl and native OS X 10.9 notifications
  • Fonts

as well as sound, app events, clipboard access, etc etc

By comparison, cordova-osx has very limited OS X desktop integration (almost none, I believe). It is also very hard to find any documentation on. Other solutions have either died (TideSDK) or are proprietary, which may or may not be what you're after.

Disclaimer: I'm a collaborator on the MacGap project.

I've never seen an app in the mac app store that uses phonegap, but I created a sencha touch app for the iphone and ipad using phonegap and I wanted to throw it into a mac app. It wasn't difficult, I didn't use Phonegap, but I used all my SenchaTouch/Javascript/html files and was able to display them in the standard webview that you can put into a mac app using interface builder. So i had native controls around the outside and my senchatouch app on the inside. You can do this with any html5 framework.

It wasn't really a good idea for my senchatouch app because that isn't designed for a traditional mouse, but it was definitely functional and worked. Also using a webview in this way wouldn't violate any of the app store submission rules (unless the app just plain sucked lol).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top