How to list All iPhone Apps By a SIngle developer

2019-07-07 20:01发布

问题:

In My Application I want show all my iPhone apps from itunes store in a tableview. If user clicks any one of cell it leads to take to appstore of that application.I know just statically by giving link of each application. As per my need i need to get new apps also after this installation.

回答1:

You can use the search web service provided by Apple: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html#searching

I couldn't find a way to search by artist ID for software, but you can still perform a generic query using the developer name.

For example, this would return apps by Gameloft:

http://itunes.apple.com/search?term=Gameloft&media=software&lang=en_US&country=us

Note that it's a query by name,so you can have false positives (apps where the name Gameloft appears but are not real Gameloft apps). You have to check the artistId property for each returned app (in this case, Gameloft's artistId is 282764297).

If you want to open the App Store to a specific app, use the trackId you got from the previous web service and then

[[UIApplication sharedApplication] openURL:
 [NSURL URLWithString:
  [NSString stringWithFormat:
   @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",
   trackId]]];


回答2:

Instead of doing your own table view, you can also use StoreKit to display the apps, and let the user purchase other apps right there. Just replace 383916386 with the correct id for your developer account.

    SKStoreProductViewController *viewCtrl = [[SKStoreProductViewController alloc] init];
    [viewCtrl loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier: @"383916386"} completionBlock:nil];
    [self presentViewController:viewCtrl animated:YES completion:nil];