Search code examples
iosapp-storebundle-identifier

Get App Store link with bundle identifier only


On Google Play, you can get a link to your app with only the package id.
Eg. https://play.google.com/store/apps/details?id=com.google.android.gm

Is there a way to do the same for App Store, using only the bundle identifier?
Eg. https://itunes.apple.com/app/gmail-email-by-google/id422689480 works but link is invalid without the id422689480: https://itunes.apple.com/app/gmail-email-by-google


Solution

  • If you want to search for an app by its bundle ID, you should use the iTunes Search API. Refer to this question.

    If you want to create an App Store link from the name of the app (as your example states), you have to follow the guidelines found here:

    There are three types of App Store Short Links, [...] one for iOS apps [...]:

    [...]

    http://appstore.com/<appname> for example, http://appstore.com/keynote

    [...]

    To create an App Store Short Link, apply the following rules to your company or app name:

    • Remove all whitespace
    • Convert all characters to lower-case
    • Remove all copyright (©), trademark (™) and registered mark (®) symbols
    • Replace ampersands ("&") with "and"
    • Remove most punctuation (See Listing 2 for the set)
    • Replace accented and other "decorated" characters (ü, å, etc.) with their elemental character (u, a, etc.)
    • Leave all other characters as-is.

    Listing 2

    Punctuation characters that must be removed.

    !¡"#$%'()*+,\-./:;<=>¿?@[\]^_`{|}~
    

    From this, your example will be:

    http://appstore.com/gmailemailbygoogle