How to figure out the app ID programmatically at runtime?

后端 未结 4 1951
刺人心
刺人心 2021-02-14 09:12

Is there a way to do that? I would hate it to hard-code the app ID somewhere...

相关标签:
4条回答
  • 2021-02-14 09:21

    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>
    

    Try it

    0 讨论(0)
  • 2021-02-14 09:34

    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.

    0 讨论(0)
  • 2021-02-14 09:38

    the code snippet provided in this question shows how to pull out the bundle seed ID via code:

    https://stackoverflow.com/a/11841898/931658

    0 讨论(0)
  • 2021-02-14 09:44

    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;

    0 讨论(0)
提交回复
热议问题