I found the following code sniplet here:
NSURL *url = [NSURL URLWithString:@"itms-apps://itunes.com/apps/???"];
[[UIApplication sharedApplication] openURL:url];
Now assume app would know if there is a new version available at the market (using own server) how to implement redirecting2/displaying correct appStore page if my app isn’t at the market yet. I need to know the link before I will upload it to apple. How to know what the url it will be?
Assuming you already have your Developer Account, you can start the app submission process. Fill out all the details, etc, but just don’t upload your binary.
Once you’ve gotten to the very end, and it’s ready for you to upload a binary, iTunes Connect will actually give you your iTunes URL. You should be able to copy and paste that into your app before building it, and uploading your final binary.
Alternatively, you could always use a URL on one of your own servers and just do a redirect to the iTunes URL. This way you can update that outside of the app. This is actually what I used to do before Apple made the URL available ahead of time.