patw0929 / react-smartbanner

Rewrite Smart App Banner in React.js.
https://patw0929.github.io/react-smartbanner/
MIT License
74 stars 56 forks source link

The "language" code in Apple App Store is incorrect #39

Closed vince1995 closed 4 years ago

vince1995 commented 6 years ago

The url for the Apple App Store is NOT https://itunes.apple.com/LANGUAGE_CODE/app/id, it's https://itunes.apple.com/COUNTRY_CODE/app/id.

That means when the browsers language is English the link to the App Store will be https://itunes.apple.com/en/app/id but it should be https://itunes.apple.com/us/app/id, https://itunes.apple.com/gb/app/id or any other country code.

patw0929 commented 6 years ago

Yup, so in code, it tries to retrieve the browser language's last two character, e.g., en-us, en-gb and zh-tw. Could you help to list the exception cases? And any advice? Thanks!

vince1995 commented 6 years ago

Ohhhhhh. You're right. But I think it's better to get the location by the IP address.