简体   繁体   English

在我的应用程序中打开App Store中的应用程序列表

[英]Open a list of my apps in the App Store within my App

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. 我已经检查了Apple网站上的(Top Paid Apps)示例代码,您可以在App Store中查看所有顶级应用程序,我想在我的应用程序中执行相同操作,但只在App Store中显示我的应用程序。 Here is the URL which i found in that sample : 这是我在该示例中找到的URL:

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

What do I need to change in this URL to show only my Apps? 我需要在此网址中更改哪些内容才能仅展示我的应用?

This is pretty easy with the SKStoreProductViewController introduced in iOS 6. With that users can buy your other apps right within the application. 使用iOS 6中引入的SKStoreProductViewController非常简单。用户可以在应用程序中直接购买其他应用程序。

First add StoreKit.framework to your project. 首先将StoreKit.framework添加到您的项目中。 Then find the iTunes URL that links to your apps using iTunes. 然后找到使用iTunes链接到您的应用的iTunes URL。 You can copy the link from the iTunes Store. 您可以从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 . 例如,Apple应用程序的URL是http://itunes.apple.com/de/artist/apple/id284417353?mt=12它包含您传递给SKStoreProductViewController的iTunes标识符。

Sample code: 示例代码:

#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

You could use DAAppsViewController . 您可以使用DAAppsViewController It can be configured with a developer ID to show all the apps by that developer. 可以使用开发者ID配置它以显示该开发人员的所有应用程序。 It will use StoreKit if available, otherwise fallback to switching to the App Store. 如果可用,它将使用StoreKit,否则将回退到App Store。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM