Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable CallKit in China (#1941) #578

Merged
merged 4 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Improvements:
* MXHTTPClient: Send Access-Token as header instead of query param (vector-im/riot-ios/issues/2071).
* MXCrypto: Encrypt the messages for invited members according to the history visibility (#559)
* MXSession: When create a room as direct wait for room being tagged as direct chat before calling success block.
* CallKit is now disabled in China (PR #578).

Bug fix:
* MXEvent: Move `invite_room_state` to the correct place in the client-server API (vector-im/riot-ios/issues/2010).
Expand Down
9 changes: 8 additions & 1 deletion MatrixSDK/VoIP/CallKit/MXCallKitAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,14 @@ - (void)reportCall:(MXCall *)call connectedAtDate:(nullable NSDate *)date

+ (BOOL)callKitAvailable
{
return [NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10,0,0}];
if (@available(iOS 10.0, *)) {
// CallKit currently illegal in China
// https://github.com/vector-im/riot-ios/issues/1941

return ![NSLocale.currentLocale.countryCode isEqual: @"CN"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/a/51319158 checks also "CHN". We could do the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2018-10-16 at 11 04 38 am

It seems like they are all two letters as least as far as iOS is concerned.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so "CN" only.

}

return NO;
}

#pragma mark - CXProviderDelegate
Expand Down