开发者

Determining the string to buy your app from within the app.(Chicken and egg)

Is there away to programmatically find what the URL to buy an app should be maybe based off the bundle ID? Can you query itunes for it?

If not, how do you go about obtaining it before you have you App approved by Apple?

The reason I ask was that I was reading a thread on requesting app ratings from the user etc and a piece of the code that was posted was

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{  
if (buttonIndex == 0) {
    [[UIApplication sharedApplication] o开发者_开发技巧penURL:[NSURL URLWithString:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=false&type=Purple+Software"]];
}
if (buttonIndex == 1) {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"HTTP_STRING_TO_PURCHASE_YOUR_APP"]];
}
}

The confusing part is: @"HTTP_STRING_TO_PURCHASE_YOUR_APP" How can that be obtained/determined before you app is on the store? Only work around that I can think of is to have some kind of config file hosted on my server that will supply this info back to the app after the app gets approved.

Am i missing something guys?

Many Thanks, Code


Once you create the app in iTunesConnect (Manage Applications/Add New App) and before you upload the binary, you can get the ID from iTunesConnect. Click on the icon for the new, not yet uploaded app. Under "Links", hover the mouse over "View In App Store" and snag the URL. This contains a string like this:

http://itunes.apple.com/us/app/app-name/id123456789?mt=8&ls=1

The 9 digit number after id is what you're after. Just add this in to the URLs to open in iTunes, purchase, rate, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜