Skip to content

[Bug]: Compliance issue PhonePermissionStrategy.m #1489

@Novarest

Description

@Novarest

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

In permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m code is copied from stackoverflow and should be replaced or deleted because there code is under a copyleft license.

Expected results

Copied code from stackoverflow will be replaced or deleted

Actual results

Copyleft code from stackoverflow is in the package

Code sample

  • (void)checkServiceStatus:(PermissionGroup)permission completionHandler:(ServiceStatusHandler)completionHandler {
    // https://stackoverflow.com/a/5095058
    if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel://"]]) {
    completionHandler(ServiceStatusNotApplicable);
    }
    completionHandler([self canDevicePlaceAPhoneCall] ? ServiceStatusEnabled : ServiceStatusDisabled);
    }

-(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;
}
}

Screenshots or video

No response

Version

main

Flutter Doctor output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions