Programmatically open Mac App Store

自古美人都是妖i 提交于 2019-11-29 22:58:57
Regexident

URLs of this pattern open up the Mac App Store:

macappstore://itunes.apple.com/app/id403961173?mt=12

So in your case:

[[NSWorkspace sharedWorkspace] openURL:
 [NSURL URLWithString:@"macappstore://itunes.apple.com/app/id403961173?mt=12"]];

will open the MAS and load the product page associated with id #403961173 (here: Angry Birds).

To just load the MAS, with no particular product page use this URL:

[[NSWorkspace sharedWorkspace] openURL:
 [NSURL URLWithString:@"macappstore://itunes.apple.com/"]];

If you just want to show the updates page you can use this URL: macappstore://showUpdatesPage

open the webpage in a UIWebView. the webview will then open itunes, or at least ask to open itunes.

that may be iphone specific. but whatever the WebView is for mac.

How about:

[[NSWorkspace sharedWorkspace] launchApplication:@"/Applications/App Store.app"]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!