我可以知道我的应用程序从其下载的iOS App Store区域吗?

时间:2018-06-27 02:46:06

标签: ios callkit

我是iOS开发人员。

最近我得知我需要从中国地区的应用程序中删除Callkit。但是我不能只发布没有与原始应用程序分开的Callkit的中文版本。因为我们的服务器端已经出售给客户,所以我不能为他们一个一个地更改苹果推送证书。因此,我需要在运行时识别中国地区。

使用位置不是一个好主意,因为我们的应用与用户的位置无关,并且可以在设置中轻松关闭它。是否有可能知道我的应用最初是在运行时下载的App Store区域?

谢谢。

1 个答案:

答案 0 :(得分:1)

如何检查语言环境区域?听起来很愚蠢,而且很容易规避,但足以满足中国的法律要求... 符合以下条件的

// Chinese country codes
NSString *const MacauChinaCountryCode = @"MO";
NSString *const ChinaCountryCode = @"CN";
NSString *const HongKongChinaCountryCode = @"HK";

...

- (BOOL)isRegionSupportedByCallKit {
    NSString *currentCountryCode = [NSLocale currentLocale].countryCode;
    NSArray<NSString *> *chineseCountryCodes = @[MacauChinaCountryCode, ChinaCountryCode, HongKongChinaCountryCode];
    return ![chineseCountryCodes containsObject:currentCountryCode];
}
相关问题