How to detect the active iTunes store on the iPhone/iPod Touch/iPad?

前端 未结 7 753
你的背包
你的背包 2020-12-07 23:29

I\'d like to be able to determine which store the user connects to from inside my app, so that I can direct them to some appropriate content for their device AND store. Doe

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 23:56

    You should probably use

    [[userDefaults dictionaryRepresentation] objectForKey:@"NSLocaleCode"];
    

    This will return a language code like en_US or en_UK or en_AU or even zh_CN, zh_MY, jp_JP and so on.

    Parse the correct codes which you support and direct them accordingly.

提交回复
热议问题