我可以确定我的 iPhone 应用程序是从哪个应用程序商店下载的吗?
iPhone 应用程序是否有办法确定它是从哪个国家/地区的应用程序商店下载的?如果该应用程序在某些国家/地区使用,我需要禁用某项功能。 NSLocale 和 MKReverseGeocoder 都是选项,但都有局限性:
如果可能的话,将应用程序的行为基于从哪个应用程序商店下载可能更合适。
Is there a way for an iPhone app to determine which country's app store it was downloaded from? I need to disable a feature if the app is being used in certain countries. NSLocale and MKReverseGeocoder are both options, but both have limitations:
How to get user's country information
Basing the app's behavior on which app store it was downloaded from might be a better fit, if it's possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有公开的 API 可以执行此操作。您可以考虑创建单独的目标。一种具有所有功能,另一种则删除了特定功能。然后,您可以创建一个单独的应用程序 ID 并将其在需要更改版本的指定国家/地区内销售。创建单独的目标并使用编译时
if
块控制流程将允许您在维护单个代码库的同时完成您想要的任务。另请参阅:
在 XCode 中构建多个 iPhone 目标
There is no API exposed to do that. You may consider creating separate targets. One with all the features, and another, with the specific features removed. You can then create a separate app ID and sell it within the designated countries that need the alterered version. Creating separate targets and controlling flow with compile time
if
blocks will allow you to accomplish what you desire while maintaining a single codebase.See also:
Building for multiple iPhone targets in XCode