0

I'm having problems opening the app store (to suggest an app update).

This is what i'm doing:

NSURL *url = [NSURL URLWithString:@"macappstore://itunes.apple.com/app/id[my_id]?mt=12"];

if ([[UIApplication sharedApplication] canOpenURL:url]){
            [[UIApplication sharedApplication] openURL:url];
}

canOpenURL is returning false, also i tried without the conditional but it doesn't work.

In addition i tried to use NSWorkspace instead the openURL method in UIApplication but i'm having compilation errors, surely this are dependencies issues but i couldn't find Cocoa.framework and neither AppKit.framework to add one of them to the binaryLibraries of my project.

Cœur
  • 37,241
  • 25
  • 195
  • 267
halbano
  • 1,135
  • 14
  • 34
  • 1
    Are you trying this on the iPhone? It won't work in the simulator. Also, I don't think you need the "macappstore" prefix. "https" will do. – brainjam Sep 20 '13 at 21:23
  • Oh! With https works. But, this open the safari browser before show the appStore app. I'm trying this on the device, yes. – halbano Sep 20 '13 at 21:49

1 Answers1

0

For iOS, you should be using the prefix itms-apps:// instead of macappstore://. This will link you directly to the App Store app, instead of through a Safari redirect (as http:// or https:// will do).

Lots more on this topic covered here: How to link to apps on the app store

Community
  • 1
  • 1
smileyborg
  • 30,197
  • 11
  • 60
  • 73