Skip to content
Draft
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
4 changes: 4 additions & 0 deletions permission_handler_apple/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 9.4.8

* Rewrite copyleft code from stackoverflow to fix compliance issue.

## 9.4.7

* Increases minimum supported Flutter version to 3.3.0, and removes code only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ - (PermissionStatus)checkPermissionStatus:(PermissionGroup)permission {
}

- (void)checkServiceStatus:(PermissionGroup)permission completionHandler:(ServiceStatusHandler)completionHandler {
// https://stackoverflow.com/a/5095058
if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel://"]]) {
UIApplication *app = [UIApplication sharedApplication];
NSURL *telURL = [NSURL URLWithString:@"tel://"];
if (![app canOpenURL:telURL]) {
completionHandler(ServiceStatusNotApplicable);
}
completionHandler([self canDevicePlaceAPhoneCall] ? ServiceStatusEnabled : ServiceStatusDisabled);
Expand Down Expand Up @@ -52,15 +53,14 @@ -(bool) canDevicePlaceAPhoneCall {
}

-(bool)canPlacePhoneCallWithCarrier:(CTCarrier *)carrier {
// https://stackoverflow.com/a/11595365
NSString *mnc = [carrier mobileNetworkCode];
if (([mnc length] == 0) || ([mnc isEqualToString:@"65535"])) {
// Device cannot place a call at this time. SIM might be removed.
return NO;
} else {
// Device can place a phone call
return YES;
NSString *networkCode = [carrier mobileNetworkCode];
if (networkCode.length == 0 || [networkCode isEqualToString:@"65535"]) {
// Device is unable to initiate a call at this time. SIM might be missing.
return NO;
}

// Mobile Network Code is valid and device can initiate a call
return YES;
}

@end
2 changes: 1 addition & 1 deletion permission_handler_apple/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: permission_handler_apple
description: Permission plugin for Flutter. This plugin provides the iOS API to request and check permissions.
repository: https://github.com/baseflow/flutter-permission-handler
issue_tracker: https://github.com/Baseflow/flutter-permission-handler/issues
version: 9.4.7
version: 9.4.8

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down
Loading