Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-16-2008, 12:50 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 8
Post connect or redirect to itunes music search from my iphone app

hello,
I have a buy button in my iphone app which i want to link to itunes music store.Any idea how to do it
sgopinath is offline   Reply With Quote
Old 10-16-2008, 01:21 PM   #2 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 361
Default

Just send someone to the link. This following excerpt is directly from the iPhone OS Programming Guide:

Quote:
You can link to the iTunes music store from your web content or launch iTunes from a native application
using a URL. The iTunes URL is complicated to construct, so you create it using an online tool called iTunes
Link Maker. The tool allows you to select a country destination and media type, and then search by song,
album, or artist. After you select the item you want to link to, it generates the corresponding URL. For example,
this HTML fragment links to a song:
<a
href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=156093464&id=156093462&s=143441">
<img height="15" width="61" alt="Randy Newman - Toy Story
- You've Got a Friend In Me"
src="http://ax.phobos.apple.com.edgesuite.net/images/
badgeitunes61x15dark.gif"></img>
</a>
Go to iTunes Link Maker FAQ for more information on creating iTunes links.

iTunes Link Maker FAQ: Apple - iTunes - Link Maker - FAQ
DevTeamOfOne is offline   Reply With Quote
Old 10-16-2008, 01:36 PM   #3 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 8
Post Re:connect to itunes store from my iphone app

thanks for the reply.
sowmya

Last edited by sgopinath; 10-16-2008 at 02:21 PM.
sgopinath is offline   Reply With Quote
Old 12-14-2008, 09:34 PM   #4 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 176
Default

I tried this, putting a link (created with the LinkMaker) in the HTML which is loaded in a UIWebView, but I just get a bunch of text in the WebView instead of being directed to iTunes. What is the code you need to have your app automatically open iTunes?
Soleil is offline   Reply With Quote
Old 12-14-2008, 09:38 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,544
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

i think it does that in the simulator, but redirects on the actual device
smithdale87 is offline   Reply With Quote
Old 12-14-2008, 09:53 PM   #6 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 176
Default

you're right- it works on the phone. thanks.
Soleil is offline   Reply With Quote
Old 12-14-2008, 10:52 PM   #7 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 176
Default

I would like to make a smoother transition though. I've seen other apps open iTunes right away. On mine, I click the link (which is displayed on an html page in a UIWebView), you see Safari open to a blank page, then it zooms out to multi-window mode, then iTunes finally opens. How do you bypass the Safari-opening steps and go straight to iTunes?
Soleil is offline   Reply With Quote
Old 12-14-2008, 10:53 PM   #8 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,544
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

I also have the same problem with my app. It opens safari, then itunes.
smithdale87 is offline   Reply With Quote
Old 12-15-2008, 10:50 AM   #9 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 8
Default Re:smooth redirect to login

To call itunes directly from your app without accessing safari use open url to connect to itunes

NSString *buyString=@"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/com.apple.jingle.search.DirectAction/search?term=dido"
NSURL *url = [[NSURL alloc] initWithString:[buyString stringByAddingPercentEscapesUsingEncoding:NSASCIIS tringEncoding]];
[application openURL:url];
[url release];



hope this helps

Sowmya Gopinath
sgopinath is offline   Reply With Quote
Old 12-15-2008, 10:52 AM   #10 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,544
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

changing the "http://" to "itms://" still causes safari to open.

Is there anything else I'm missing?
smithdale87 is offline   Reply With Quote
Old 12-15-2008, 10:56 AM   #11 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 8
Default re:smooth redirect to login

it will work in the device (not simulator).It works for me unless you don't have itunes

Sowmya Gopinath
sgopinath is offline   Reply With Quote
Old 12-15-2008, 01:35 PM   #12 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 176
Default

changing to itms://phobos... seems to work for me too. thanks!
Soleil is offline   Reply With Quote
Old 01-18-2009, 10:50 AM   #13 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 15
Default iTunes with artist ID

This string works for me on my iPhone app:

NSString *sstring = [NSString stringWithFormat:@"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&co untry=US&term="Duran Duran"];

But I want to be able to search by artist ID instead of name.

However, this following string does not work on my iphone app:

NSString *sstring = [NSString stringWithFormat:@"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/WOURLEncoding=ISO8859_1&lang=1&output=lm&country=U S&viewArtist?id=23456"];

Or this either

NSString *sstring = [NSString stringWithFormat:@"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/viewArtist?id="23456"];

So how do I bring up iTunes from my iPhone app with an artist ID rather than a search term like artist name?
kenroyandfamily is offline   Reply With Quote
Reply

Bookmarks

Tags
buy button, iphone developer, iphone development, itunes

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 880
12 members and 868 guests
aziz, chiataytuday, fiftysixty, harsha_0409, klbaiju, leahov, Morgan72, Shubhank, snackbox, Snail, Vineesh, viperfan91
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,297
Threads: 89,032
Posts: 379,810
Top Poster: BrianSlick (7,086)
Welcome to our newest member, Snail
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:09 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0