 |
 |
|
 |
10-16-2008, 11:50 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 8
|
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
|
|
|
10-16-2008, 12:21 PM
|
#2 (permalink)
|
|
New Member
Join Date: Aug 2008
Posts: 361
|
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
|
|
|
|
10-16-2008, 12:36 PM
|
#3 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 8
|
Re:connect to itunes store from my iphone app
thanks for the reply.
sowmya
Last edited by sgopinath; 10-16-2008 at 01:21 PM.
|
|
|
12-14-2008, 08:34 PM
|
#4 (permalink)
|
|
Registered Member
Join Date: Dec 2008
Posts: 172
|
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?
|
|
|
12-14-2008, 08:38 PM
|
#5 (permalink)
|
|
Magic Hands' Daddy
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,372
|
i think it does that in the simulator, but redirects on the actual device
|
|
|
12-14-2008, 08:53 PM
|
#6 (permalink)
|
|
Registered Member
Join Date: Dec 2008
Posts: 172
|
you're right- it works on the phone. thanks.
|
|
|
12-14-2008, 09:52 PM
|
#7 (permalink)
|
|
Registered Member
Join Date: Dec 2008
Posts: 172
|
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?
|
|
|
12-14-2008, 09:53 PM
|
#8 (permalink)
|
|
Magic Hands' Daddy
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,372
|
I also have the same problem with my app. It opens safari, then itunes.
|
|
|
12-15-2008, 09:50 AM
|
#9 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 8
|
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
|
|
|
12-15-2008, 09:52 AM
|
#10 (permalink)
|
|
Magic Hands' Daddy
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,372
|
changing the "http://" to "itms://" still causes safari to open.
Is there anything else I'm missing?
|
|
|
12-15-2008, 09:56 AM
|
#11 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 8
|
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
|
|
|
12-15-2008, 12:35 PM
|
#12 (permalink)
|
|
Registered Member
Join Date: Dec 2008
Posts: 172
|
changing to itms://phobos... seems to work for me too. thanks!
|
|
|
01-18-2009, 09:50 AM
|
#13 (permalink)
|
|
Registered Member
Join Date: Jan 2009
Posts: 12
|
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?
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 429 |
| 43 members and 386 guests |
| anandahdaa, bensj, bobvanratingen, BrianSlick, CAmaninacan, craiggil, Eagle11, efreeet, Erle, firearasi, flamingliquid, fredidf, ftm, gandohr, gbaldwin9, georgeburns, Gi-lo, goodcode, harrytheshark, HemiMG, hm50, hoisty, JasonR, javaconvert, Leopard, mac514, Meoz, NeoNate, Noise, not_too_shabby, paolo, prathumca, redon, Roi, Rudy, scatterbrn, schoash, shad1236, shark4ever, The Blind Bandit, wassupdoc, yannickd60, ZunePod |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,296
Threads: 39,091
Posts: 171,393
Top Poster: smasher (2,575)
|
| Welcome to our newest member, Issue |
|