Is it possible to get app id from iOS application programmatically? Is it possible to get app id from iOS application programmatically? objective-c objective-c

Is it possible to get app id from iOS application programmatically?


Yes, it is. You can't get appstore app id (called Apple ID in iTunes Connect) offline, but you can request it using iTunes Search Api. Download the context of the following link:

http://itunes.apple.com/lookup?bundleId=YOUR_APP_BUNDLE_ID

You will get a JSON response, containing "trackId":YOUR_APP_ID key-value. Try it in your browser!

My answer is based on the another answer: https://stackoverflow.com/a/11626157/3050403


Use

NSString* appID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];

Updating the answer with comment by @zaheer

Bundle.main.infoDictionary?["CFBundleIdentifier"] as? String


You can use the Apple iTunes Link Maker to search for your App (or any app for that matter) and get your App Store URL. From there you could get your App URL which will remain the same for your App and put it in your Application. When you use itms:// instead of http://, it will directly open in the App Store app directly

For example, if I wanted to use the Twitter App URL, the link maker tells me the URL is:

http://itunes.apple.com/us/app/twitter/id333903271?mt=8&uo=4

Now do the itms trick:

itms://itunes.apple.com/us/app/twitter/id333903271?mt=8&uo=4

And it will directly open in the App Store than redirect via Safari then to the App Store,