iTunes links go to iTunes store (don't open in UIWebView...)


#1

Joe,
Am I missing something? Are you able to get the iTunes HTML to show in the UIWebViewController? It redirects to the iTunes store on an actual device but does nothing on the simulator. Is there a way to tell apps to ignore redirects to links to the itunes store?

In a browser this:
itunes.apple.com/us/album/gravit … 47726?uo=2

redirects to this:
itunes.apple.com/us/album/gravit … mpt=uo%3D2

Related discussions are here:
stackoverflow.com/questions/1131 … -apple-com
developer.apple.com/library/ios … a1629.html

Thx,
Greg


#2

If you use the online json viewer to view the structure of the itunes json:

jsonviewer.stack.hu/#http://itun … it=10/json

you will see there are two elements under link (entry -> link), the first one is the actual song link
itunes.apple.com/us/album/gangn … 98387?uo=2

the second one is the 10-20sec preview of the song:

a324.phobos.apple.com/us/r1000/0 … .aac.p.m4a

I think the book simply asks you to link to the sample clip (.m4a), not the first one:

if ([links count] > 1) {
     NSDictionary *sampleDict = [[links objectAtIndex:1] objectForKey:@"attributes"];
     // The href of an attribute object is the URL for the sample audio file
     [b][self setLink:[sampleDict objectForKey:@"href"]]; [/b]
}

OT: what the heck is Gangnam Style?