Launching the App Store from an iPhone application

https://developer.apple.com/library/ios/qa/qa1629/_index.html

Q:  How do I launch the App Store from my iPhone application? Also, how do I link to my application on the store?

A: The -[UIApplication openURL:] method handles links to applications and media by launching the appropriate store application for the passed NSURL object. Follow the steps below to obtain a link to an application, song, or album sold on iTunes, and link to it from your iPhone application:

  1. Launch iTunes on your computer.

  2. Search for the item you want to link to.

  3. Right-click or control-click on the item's name in iTunes, then choose "Copy iTunes Store URL" from the pop-up menu.

  4. Open the modified URL using an NSURL object and the -[UIApplication openURL:] method.

See Listing 1 for an example that launches the App Store from a native application.

Listing 1  Launching the App Store from an iPhone application.

NSString *iTunesLink = @"http://itunes.apple.com/us/app/id284417350?mt=8";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值