1
votes

I'm an iOS developer.

Recently I was informed that I need to remove Callkit from my app in China region. But I can't just release a Chinese version without Callkit that separated from the original app. Because our server end has already been sold to customers, I am not able to alter the apple push certificate for them one by one. So I need to identify the China region in runtime.

Using location is not a good idea since our app has nothing to do with user's location and it can be easily turned off in settings. Is it possible to know the region of App Store that my app was originally downloaded from in runtime?

Thank you.

1
Probably the only way you can do it is to check the public in address of the device; if it maps to China then disable the Callkit features.Paulw11

1 Answers

1
votes

What about checking the locale region? It sounds stupid and very easy to circumvent but it might be good enough to fulfil the chinese legal requirements... Something in the lines of:

// 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];
}