views:

127

answers:

2

I'm making an iPhone app that has information about different video games. How can I implement a shopping API that will allow me to redirect users who choose to buy a game?

In other words, I'm looking for some kind of affiliate program API that works with the iPhone and lets me place item buy buttons that redirect the user to a product page.

Thanks.

+1  A: 

Hi Anthony,

what about pointing to the itunes page, e.g.

http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8

if you replace "itunes" by "phobos", the app store will be opened when using the iphone to open the linkg, e.g.

http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8

henchman
+3  A: 

Your intent is unclear. Are you trying to sell content for your application? If so, there is an established, Apple-approved way to do this:

http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StoreKitGuide/AddingaStoretoYourApplication/AddingaStoretoYourApplication.html

If you're trying to sell something non-iPhone-related, you should redirect to a web page that actually handles the transaction. You can do this as a link that opens a page in Safari, or as an embedded UIWebView.

The first approach is simplest:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www.google.com"]];

The second a little more complicated:

http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html

If your question is really asking how to build an entire product purchase API, then, not to sound sarcastic, I suggest this site as a useful starting point:

http://www.amazon.com/books/

Ian Henry
I'm trying to allow affiliate links so that way any referrals somewhere can help me get a percentage of the referred sale.
Anthony Glyadchenko
Most referral programs work by linking a custom URL that includes your unique account identifier. There is no iPhone-specific magic you'll need to do implement this, just open them as links in Safari. For example, Amazon's: https://affiliate-program.amazon.com/
Ian Henry