0

Possible Duplicate:
How to link to apps on the app store

I have a special need on my iPhone app. I have on my app some content that is linked to other content in iTunes. Of course, the link of the iTunes element is different for each store (contains /us/ or /fr/ or /gb/ etc.). So, in order to display to the user the right link (the one that will lead him to his store, and not to the error: "Not the good store"), I need that info. I don't want to use CoreLocation.

In fact, I need that because I'm retrieving the links from my API, and I send the country code to the API to return the correct links for the country.

Thanks,

Edit : Like I said in a comment below, NSLocale is not a perfect fit for me. It is what I am using, but the locale doesn't tell exaclty which store the user is on. For example, I have my phone set in English (US) and my store is the French one. So, I want to have FR, not US.

Edit 2 : I am talking about tv shows, not apps (for which there is a unique link that can be opened in any app store). Here is an example, for the pilot of stargate atlantis :

FR link => https://itunes.apple.com/fr/tv-season/une-nouvelle-ere-1ere-partie/id370061110?i=370381192&uo=4

US link => https://itunes.apple.com/us/tv-season/rising-pts.-1-2/id260813591?i=261784660&uo=4

Edit 3 : Apparently, the new iOS can handle to open links in the local store, even if the link is for another store.

But I still have a problem because some items are available in only one store. So, without the precise store, I may display links to the user that are not available in his local store.

Community
  • 1
  • 1
Talal MAZROUI
  • 645
  • 1
  • 6
  • 12
  • Not really, because the content I'm trying to link are tv shows, not apps. For apps, indeed, there is a unique link that can be opened on any app store. For the iTunes store, it doesn't seem to be the case – Talal MAZROUI Jan 15 '13 at 16:52

1 Answers1

1

try omitting the country all together :p seriously

for example you have this URL

https://itunes.apple.com/fr/tv-season/une-nouvelle-ere-1ere-partie/id370061110?i=370381192&uo=4

change it to simply

https://itunes.apple.com/tv-season/une-nouvelle-ere-1ere-partie/id370061110?i=370381192&uo=4

You will only be presented with an error notice,only, if the content is not available in the users home store.

AppHandwerker
  • 1,758
  • 12
  • 22
  • Yeah, NSLocale can give me the current language of the user, but it's not linked to the store he uses. For example, I have my phone set in english, but I use the French store. So, what I want is FR, not US. – Talal MAZROUI Jan 15 '13 at 16:30
  • What do you mean, try omitting the country? – Talal MAZROUI Jan 15 '13 at 16:48
  • don't include it in the URL. Also you should look at the duplicate answer >http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store – AppHandwerker Jan 16 '13 at 08:53
  • Yeah, finally, when I don't include it in the URL, the correct element is opened. But as I said on my edit, I still need the local store to retrieve from the server only the elements that are available in the user's store . For example, today, Breaking Bad episode 6 of season 5 is available on the US store, and not the french one. So, if a french user has his phone in english, I will retrieve the link for the episode, but once it opens the itunes store, it won't open the episode page, just display an alert asking the user to change its store. And that's what I want to avoid. – Talal MAZROUI Jan 16 '13 at 09:22