On the iPhone, how can you cause a URL to display an entry in the App Store?

前端 未结 3 1157
别跟我提以往
别跟我提以往 2021-01-13 09:51

For instance, if someone views a URL for an app on the iPhone, we would like the URL to open the App Store and display the entry related to that app. The idea is to allow d

3条回答
  •  有刺的猬
    2021-01-13 10:15

    EDITED for a better answer:

    There's a specific url type for the App Store. Using it will prevent Safari and iTunes from popping up first. The App Store link is:

    itms-apps://
    

    As an example, you could do this in response to the user tapping a button (or whatever action):

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"itms-apps://yourAppLinkHere"]];
    

    You can get the correct app link from the iTunes Link Maker at http://itunes.apple.com/linkmaker

    In the case of one of my apps, it would look like this:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"itms-apps://itunes.apple.com/us/app/its-on-my-way/id334996949?mt=8&uo=4"]];
    

提交回复
热议问题