1

I'm adding the ability for users to share a promo code and link to my app via

    NSString *string = [NSString stringWithFormat:@"Share my app ! Use my referral code %@ ", self.actualPromoCodeLabel.text];
NSURL *URL = [NSURL URLWithString:@"tel://1234567890x101"];

However, because the app is being submitted now, how can I know what value to include in the NSURL so that when clicked, it bring the app to my app in the apps tore?

DaynaJuliana
  • 1,144
  • 1
  • 14
  • 33

1 Answers1

2

This is absolutely the easiest thing you have probably overlooked and once you know the answer you'll slap your forehead and say ohhh, duh!

All apps are unique by their App ID:

A unique number that Apple assigns to the app.

When you sign into iTunes Connect simply navigate to the app in question and as of now (2015 April 5) under the 'General Information' section you will find an 'Apple ID' number under your App Icon

Now you have your unique link to use in sharing circumstances.

Generally, when you share a link to the app store via url it will be in this format:

https://itunes.apple.com/us/app/appname/idYOURID#?mt=8

Where does this link come from you may ask?

Simple. Apple gave us iTunes Link Maker for you to get your own link to an already published work. You can search for anything in 'iOS Apps' and see the links have the same foundation, the only thing that's different is your app name and app ID #

So lets say your ID # is 123456789 and your app name is Example :

https://itunes.apple.com/us/app/example/id123456789?mt=8

Now lets say your app has more than one word in the name followed by a space, you would change the space for a hyphen, so lets say your app name is now Share Example :

https://itunes.apple.com/us/app/share-example/id123456789?mt=8

Now all you have to do is include this in any url hyperlinks within your app before you submit to the store.


Now just share!

NSString *appStoreLink = @"https://itunes.apple.com/us/app/share-example/id123456789?mt=8";
NSString *string = [NSString stringWithFormat:@"Share my app ! Using this link : %@ ", appStoreLink];

This works in development so you can test as you as go prior to submission. The only downfall to this is that Apple can change it without notice. But a platform with that many apps, I don't think they would alter a prefix/suffix search specific url too often

soulshined
  • 9,612
  • 5
  • 44
  • 79
  • Wow ! This is a 3 AM slap in the face moment for sure ! Thanks 1 – DaynaJuliana Apr 05 '15 at 18:03
  • I thought the itms format was to link to the store directly? http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store – DaynaJuliana Apr 05 '15 at 18:05
  • 1
    @DaynaJuliana it was previously, i believe the support stopped after iOS 6 but don't quote me on that. i know that was the last time you could directly link to the reviews page of your app in the store. But the old phobos doesn't work anymore. I don't think you can go wrong by providing the link that Apple themselves provide. I used this method in app that was published to the store this year and it worked just fine with no redirects once it was live and indexed – soulshined Apr 05 '15 at 18:13