我是一名iOS开发人员。
最近我被告知,我需要从我的中国地区的应用程序中删除Callkit。但我不能在没有Callkit的情况下发布中文版本,Callkit与原始应用程序分离。因为我们的服务端已经卖给客户了,所以我不能为他们一一修改苹果推送证书。因此,我需要在运行时确定中国区域。
使用location不是一个好主意,因为我们的应用程序与用户的位置无关,而且可以很容易地在设置中将其关闭。有没有可能知道我的应用在运行时最初下载的App Store所在的区域?
谢谢。
发布于 2018-07-04 16:18:02
那么如何检查地区呢?这听起来很愚蠢,很容易绕过,但它可能足以满足中国的法律要求……某物类似于:
// 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];
}https://stackoverflow.com/questions/51053847
复制相似问题