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

前端 未结 6 1075
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 11:59

Is there any way for getting appstore id from running iOS application? (For asking user to rate it and providing link to appstore.)

6条回答
  •  庸人自扰
    2021-01-01 12:36

    For the appId only you need to separate the bundle identifier string by components and simply grab the last component.

    NSString appId = [[[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"] componentsSeparatedByString:@"."] lastObject];
    

    Or handle the full string accordingly but it will have the entire bundle identifier.

提交回复
热议问题