Skip to content

Unable to receive whether UIApplication.openURL(_:options:completionHandler:) was successful #128

Description

@naoigcat

SCCAPIConnection.performRequest(_:error:) returns YES even if UIApplication.openURL(_:options:completionHandler:) fails (i.e. Square Point of Sale fails to launch).

The launch failure occurred once, but the condition of occurrence could not be specified.

Code

https://github.com/square/SquarePointOfSaleSDK-iOS/blob/291656d64d633a2876b61fa3f1b5c3935ebe2e3a/Sources/SCCAPIConnection.m#L83-92

+ (BOOL)_performRequestWithURL:(nonnull NSURL *)URL error:(out NSError *__nullable *__nullable)error;
{
    if (![self _canPerformRequestWithURL:URL error:error application:[UIApplication sharedApplication]]) {
        return NO;
    }

    [[UIApplication sharedApplication] openURL:URL options:@{} completionHandler:nil];

    return YES;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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