在我的 App 内的 App Store 中打开我的应用程序列表 [英] Open a list of my apps in the App Store within my App

查看:27
本文介绍了在我的 App 内的 App Store 中打开我的应用程序列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查了 Apple 网站上的(热门付费应用)示例代码,您可以在其中查看 App Store 中的所有热门应用,我想在我的应用中执行同样的操作,但仅在 App Store 中显示我的应用.这是我在该示例中找到的 URL:

I have checked the (Top Paid Apps) sample code from Apple website where you can see all the top apps in the App store, I want to do the same in my app but to show only my apps in the App Store. Here is the URL which i found in that sample :

http://phobos.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppaidapplications/limit=75/xml

我需要在此 URL 中更改哪些内容才能仅显示我的应用?

What do I need to change in this URL to show only my Apps?

推荐答案

使用 iOS 6 中引入的 SKStoreProductViewController 非常容易.用户可以直接在应用程序中购买其他应用程序.

This is pretty easy with the SKStoreProductViewController introduced in iOS 6. With that users can buy your other apps right within the application.

首先将 StoreKit.framework 添加到您的项目中.然后使用 iTunes 找到链接到您的应用程序的 iTunes URL.您可以从 iTunes Store 复制链接.例如,Apple 应用程序的 URL 是 http://itunes.apple.com/de/artist/apple/id284417353?mt=12它包含传递给 SKStoreProductViewController 的 iTunes 标识符.

First add StoreKit.framework to your project. Then find the iTunes URL that links to your apps using iTunes. You can copy the link from the iTunes Store. For example the URL for the Apple apps is http://itunes.apple.com/de/artist/apple/id284417353?mt=12 It contains the iTunes identifier, that you pass to the SKStoreProductViewController.

示例代码:

#import "ViewController.h"
#import <StoreKit/SKStoreProductViewController.h>

@interface ViewController ()<SKStoreProductViewControllerDelegate>
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self showMyApps];
}

-(void)showMyApps
{
    SKStoreProductViewController* spvc = [[SKStoreProductViewController alloc] init];
    [spvc loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : @284417353}
                    completionBlock:nil];
    spvc.delegate = self;
    [self presentViewController:spvc animated:YES completion:nil];

}

-(void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end

这篇关于在我的 App 内的 App Store 中打开我的应用程序列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆