How can I allow affiliate links to items in my iPhone app? - iphone

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.

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/

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

Sorry, I may be misunderstanding what you are asking but I'm interpreting your question as you want to create an "app discovery" app where you recommend other iOS games in the App Store. If this is correct then you will want to use the iTunes / App Store Affiliate Program.
More info here -
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-app-store-affiliate-program.html
The API you would then use is the "Search API." More info about that can be found here -
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html

Related

Link to use when iOS app/game posts to Facebook or Twitter

I just developed a new game (called Ktalu: Planet of Terror) in iOS using COCOS2D. The game itself is done but I have to finalize a couple of things, one being the following. This game allows users to post their high scores on Facebook and/or Twitter, and everything works fine right now. The Facebook post shows up as expected and some of the text is linked to a URL of my choice. My question is what link should I use here? I can link to the website of the game (ktalu.com) but it is probably a better idea to link directly to the game in the App Store. This way, anyone who sees a post on Facebook when reading on an iPhone can click the link and be taken directly to App Store. But I am confused as to how to do this. The only link I have now is a link to the game in iTunes Connect. Remember, this game is not published yet. How can I get an App Store link for this game to put into Facebook posts and Tweets if the game is not yet in the App Store? And what exactly does this link look like? Is it http, https, or something else? And what happens if someone reads the post on a laptop or desktop and clicks that link?
The "View in App Store" link (Manage Apps, ) is exactly what you want. That URL will work once an app goes live, even if copied pre-launch because it doesn't change. When followed on a non-iOS computer, this link goes to the online store. When followed on iOS, this link goes to the App Store.
Protip: Use the URL scheme "itms://" instead of "http://" to link directly to your app in iTunes on the desktop/laptop. Both go directly to the App Store on iOS.
If you'd like to construct the URL yourself, follow my previous instructions:
In iTunes Connect you need to find the "Apple ID" for your app (it's a 9 digit number found in Manage Apps, Ktalu). Then simply find a link to any other app and replace the ID with yours.
For example, the Apple ID for Google Maps is 585027354 and its online URL is https://itunes.apple.com/us/app/id585027354.

iphone - adding option for gifting the app

In my iphone app, i'd like to add the option to "Gift" the app.
Basically I like to add a button which pops up the username to whom i want to gift.
Is this possible?
As far as i know this functionality is part of the App Store and there is no API to provide that functionality in-app.
CheersShai
The best you can do is make the "gift" button open up the app store pointing to the app's page (which is still useful, IMO).
Once you have the web URL for your app, tell your UIApplication to open it and the user will land in the App Store app:
How to link to apps on the app store
Make sure you use the itms-apps:// hint below the accepted answer or you'll wind up with a double redirect which is annoying.

Is It Possible To Add A "Rate This App" Link To My App?

Here's what I'm trying to do: I have a button on the settings page in my app - I want this to direct users to the review/rate page on the app store.
I know this is possible using [[UIApplication sharedApplication] openURL: .... ]; but my app is unreleased as of yet, so I don't have a URL to use.
Is it possible to implement this functionality for an unreleased app, or would I have to wait and include it as an update?
Thanks :)
The URL below is what you're looking for.
Just replace the 368754825 after id= with your app's Apple ID from iTunes Connect. This will take you right to the review page and won't have all the redirects like a normal link. Your App's Apple ID will not change between now and when it's on the store.
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=368754825&pageNumber=0&sortOrdering=1&type=Purple+Software&mt=8
Update:
I tested the link I posted more than a year ago. It still works. The idea is that it won't work until your app is live. I know there's some concern about putting this link in and shipping before actually verifying it works, but it's the best option for having a review link in a 1.0. You can alternatively submit a 1.0.1 update (with link) right after 1.0 (without link) is approved which means you're only missing out on about a week's worth of reviews.
This is newest format for creating review form links on iOS (only works for iOS devices) [tested on 4.2]
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=412843648
Replace the final string of 9 numbers with your app's application ID from iTunes connect or your iTunes url. This link when launched from an iOS device takes you directly to the reviews
Yes you can add a link.
What I did for one of my apps that wasnt released yet was point to a certain URL, like: http://www.wrightscs.com/ios/myapp/review.html which just contained an http redirect.
Once my app was released and I had the iTunes Store link, I just updated the review.html page with my apps URL.
So now my app opens the review.html link, but in return gets redirected to my app in the app store.
First of all you have all the data about your app when creating it on iTunes connect. The thing you need here is the "Apple ID" (you can find it on iTunes connect under the app information).
After taken this number you can use it inside your app (even hard-coded) asking users to rate it or any other thing you want to do with it.
You can use this code for doing so, This method would open the rate page for your app on the App Store without opening safari on the way like other methods here (I've put all code which seems easier to understand sometimes):
static NSString *const iOSAppStoreURLFormat=#"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%u";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:iOSAppStoreURLFormat, (unsigned int)YOUR_applicationID]]];
Where YOUR_applicationID is the one you took from the app store (Apple ID).
I suggest you test that with a working app (active on the app store, even not your, You can use this one for example: 474785950) and change it afterwards. Pay attention to download the app you are rating to your device/account (You can always know the Apple ID of working apps from the link itself : http://itunes.apple.com/us/app/i-ruler/id474785950?ls=1&mt=8 it's the number just after the "id").
Moreover, For this topic I have some other things that should be considered:
1. Apple can reject your app if you are asking users to rate your app with 5 stars, Many developers does that and don't get rejected but I've been rejected couple of times just for that. Beware!
2. Asking users for just a rating mostly doesn't have a good effect, Great feedback comes only after the user used the app and really enjoyed that (users are really used to popups asking them to rate and just skip it). Also if user want to skip this process for now you want to try asking him later, And most importantly you want to ask the user to rate your app after an update (that is super important because rating is for each version!). To solve this case I suggest using iRate (or build something custom using that as starting point) which is very easy to integrate and it can ask for rating only after several days/opening times etc. and remembers to do that for each version. Can download it from: https://github.com/nicklockwood/iRate/tree/master/iRate
I think that the direct link to 'write the review' is undocumented. It is better to give link to the app and it will be up to user to write the review.
You can get the link to your app from your account in iTunes Connect.
You will get the link once you add a new application (not necessarily upload and make it live). That link will open your app regardless of the platform (iPhone, Mac, PC).
That link will not work un till the app is live.
This method worked for me!
Swift 2 version this code works for iOS 9:
let appId = "12345678"
let url = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=\(appId)"
UIApplication.sharedApplication().openURL(NSURL(string: url)!)

Is there any mechanism provided by Apple Store to make the user sign-up to my website before he/she can download the application?

I am creating an iphone application that requires the users to have an account at my website.
But if i have to distribute it through apple store, how should I make the users of this Iphone Application first create an account with my website. There could be a few options like :
1) Ask the user to create an account when he/she tries to run the application on iphone.
2) Provide a 'Sign-Up' page in the Iphone application itself.
My question is "Is there any mechanism provided by Apple Store to make the user sign-up to my website before he/she can download the application".
Kindly give in your suggestions for the same. Which would be the best approach for solving my problem.
Thanks,
LG
There's no way to do this through the app store.
Yes: your two options are to create a sign in / sign up screen with cocoa, or to display your login webpage with a NSWebview.
I'd recommend the native control route...
No, you can't do that through Apples App Store.
You could provide the user with aviability to register to your site when opening your app, throug, say a NSWebView.
There are many ways to solve this, just not the one you might like.

sending request to apple - from iphone custom application

Let me explain the application.
Before starting my question, I would like to say the following. (for specification of my question)
For example
in Mac os
User Starts iTunes
User Clicks on iTunes Store
User can see the different applications, videos etc.
After he will select specific application/video to purchase it.
ID - Password is required.
( this entire process is before the purchase, means doesn't require any apple id password )
I have to develop an application which fulfill same requirement as iTunes have. But I am not able to even start it.
User starts my application
User can see the all applications developed by my Company. ( Say for example my company has 10 applications developed. )
Items are in table view. or may be other control.
In short I have Items, The thing that I Require is " How to send request to apple / when user select my application to purchase? Or what to do - I have no idea about it. "
user clicks and add items to cart.
OK. Now here my question starts.
How to send
request to apple - server when user
taps on specific item ?
What kind of / How many accounts / certificates are required to do the above task ?
I'm no expert on this but I have a strong feeling that Apple isn't going to allow purchases on its store using a third-party application. What exactly are you trying to do?
http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction/Introduction.html
You can use In-App Purchase to unlock additional features of your application, to enable or download additional data sets, or even sub-products of your main product (the guide above specifically mentions a game with multiple smaller games that can be purchased.
You cannot use In-App Purchase to build your own App Store.
you should read in app purchase guide on apple's site
Two options:
As stated above, use the in-app-purchase mechanism, with the limitations posted by cdespinosa
Simply forward the user to the iTunes link for your applications.
Here comes a little example snippet that is pointing towards a piece of music - same works for applications - use the iTunes link-generator on the Apple site for this purpose:
http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/itmsLinkMaker
#ifdef TARGET_IPHONE_SIMULATOR
NSString *buyString=#"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=314186312&id=314186290&s=143443&uo=6";
#else
NSString *buyString=#"itms://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=314186312&id=314186290&s=143443&uo=6";
#endif
NSURL *url = [[NSURL alloc] initWithString:[buyString stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
[[UIApplication sharedApplication] openURL:url];
[url release];