Is there a way to do that? I would hate it to hard-code the app ID somewhere...
Asked
Active
Viewed 9,128 times
10
-
1What do you mean by app ID? The application ID associated with a signature in iTunes connect, or the bundle identifier located in the Info.plist? – Claus Broch Jul 10 '10 at 11:56
4 Answers
21
If you mean your com.whatever.whatever identification:
NSString *myAppID = [[NSBundle mainBundle] bundleIdentifier];
If you mean your iTunes id123456789 identification, it's not available to you at runtime, but is given to you on iTunes Connect and can be manually inserted into your app from there.

Jonathan Grynspan
- 43,286
- 8
- 74
- 104
-
1The iTunes identification number is what he probably means. You are right. There is no way to do this at runtime (file a radar -- it should not be hard considering the iPhoneOS device DOES know this info in order to do updates for itself). – Jann Jul 10 '10 at 22:45
-
2UPDATE: It is possible to determine your iTunes id at runtime by querying Apple's server. This is what plug-ins like iRate use. All you need to do is call the following url and parse the response for the `trackId` field. `https://itunes.apple.com/US/lookup?bundleId=
` – BFar Dec 12 '15 at 20:06
6
No way to do this. I think you are probably trying to link to your product page right? Try the link method using your name of your app
http://itunes.com/apps/<YOUR APP NAME>

coneybeare
- 33,113
- 21
- 131
- 183
-
I tried it and it works; this is the easier, elegant solution, and probably the only one `:-)`. Now, dontWatchMyProfile should enlighten us about what he really mean. `:-)` – apaderno Jul 10 '10 at 12:06
3
try reference THIS on developer.apple.com. (need account on developer appleID)
U can use like below. add AVFoundation.Framework to your Project. import header "AVFoundation/AVFoundation.h"
U can use constants below. NSString *const AVMetadataiTunesMetadataKeyAppleID;

JoeCortopassi
- 5,083
- 7
- 37
- 65

TopChul
- 419
- 2
- 14
-
Could you please show me a way, how you would retrieve the key's value (AVMetadataiTunesMetadataKeyAppleID) from an app? Is there a possibility to do that without jailbreaking the i-Device? Thx – NicTesla May 30 '12 at 15:26
-
-
I didn't try this. It should be possible last iOSs. The meta plist file could be read with iExplorer. Now, this meta plist file cannot be access with iExplorer. I yet did not try this. but, I would try this on iOS7 as soon as possible. Good luck.~ – TopChul Oct 08 '13 at 07:43
0
the code snippet provided in this question shows how to pull out the bundle seed ID via code:

Community
- 1
- 1

sean808080
- 242
- 4
- 13