Skip to content

Commit

Permalink
Merge branch 'feature/iOS-11-fixes' into 'feature/native-payments'
Browse files Browse the repository at this point in the history
Bumped to iOS 11 and fixed all warnings

See merge request swedbank-pay/swedbank-pay-sdk-ios!7
  • Loading branch information
mbalsiger committed Oct 4, 2024
2 parents d4e969f + 7dd5605 commit c792773
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion SwedbankPaySDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The Swedbank Pay iOS SDK enables simple embedding of Swedbank Pay Checkout to an
s.author = 'Swedbank Pay'
s.source = { :git => 'https://github.com/SwedbankPay/swedbank-pay-sdk-ios.git', :tag => s.version.to_s }

s.ios.deployment_target = '10.0'
s.ios.deployment_target = '11.0'
s.swift_versions = '5.0', '5.1'

s.source_files = 'SwedbankPaySDK/Classes/**/*'
Expand Down
6 changes: 2 additions & 4 deletions SwedbankPaySDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1637,7 +1637,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -1660,7 +1660,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwedbankPaySDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1685,7 +1684,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwedbankPaySDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
2 changes: 1 addition & 1 deletion SwedbankPaySDK/Classes/Api/Helpers/CustomDateDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import Foundation

class CustomDateDecoder: JSONDecoder {
class CustomDateDecoder: JSONDecoder, @unchecked Sendable {
let dateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.timeZone = TimeZone(identifier: "UTC")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SwedbankPayAuthorization: NSObject {

paymentRequest.merchantIdentifier = merchantIdentifier

if let merchantCapabilities = task.expects?.first(where: { $0.name == "MerchantCapabilities" })?.stringArray?.contains(where: { $0 == "supports3DS" }) {
if (task.expects?.first(where: { $0.name == "MerchantCapabilities" })?.stringArray?.contains(where: { $0 == "supports3DS" })) != nil {
paymentRequest.merchantCapabilities = .threeDSecure
}

Expand Down Expand Up @@ -85,7 +85,7 @@ class SwedbankPayAuthorization: NSObject {
extension SwedbankPayAuthorization: PKPaymentAuthorizationControllerDelegate {
func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) {
if let handler = self.handler {
if let status = status {
if status != nil {
handler(.success((success)))
} else {
handler(.failure(self.errors?.first ?? SwedbankPayAPIError.unknown))
Expand Down
4 changes: 1 addition & 3 deletions SwedbankPaySDK/Classes/Beacon/BeaconEndpointRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ struct BeaconEndpointRouter: BeaconEndpointRouterProtocol {

extension BeaconEndpointRouter {
func makeRequest(handler: @escaping (Result<Void, Error>) -> Void) {
let requestStartTimestamp: Date = Date()

requestWithDataResponse { result in
switch result {
case .success(let data):
case .success:
handler(.success(()))
case .failure(let error):
handler(.failure(error))
Expand Down
2 changes: 1 addition & 1 deletion SwedbankPaySDK/Classes/SwedbankPayPaymentSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public extension SwedbankPaySDK {
switch result {
case .success:
self.scaMethodRequestDataPerformed.append((name: task.expects?.first(where: { $0.name == "threeDSMethodData" })?.value ?? "null", value: "Y"))
case .failure(let error):
case .failure:
self.scaMethodRequestDataPerformed.append((name: task.expects?.first(where: { $0.name == "threeDSMethodData" })?.value ?? "null", value: "N"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,23 @@ public extension SwedbankPaySDKConfigurationAsync {
@available(*, deprecated, message: "no longer maintained")
func urlMatchesListOfGoodRedirects(_ url: URL) async -> Bool {
return await withUnsafeContinuation { continuation in
urlMatchesListOfGoodRedirects(url, completion: continuation.resume(returning:))
urlMatchesListOfGoodRedirects(url, completion: { _ in
Task { @MainActor in
continuation.resume(returning:)
}
})
}
}

func decidePolicyForPaymentMenuRedirect(
navigationAction: WKNavigationAction
) async -> SwedbankPaySDK.PaymentMenuRedirectPolicy {
return await withUnsafeContinuation { continuation in
decidePolicyForPaymentMenuRedirect(navigationAction: navigationAction, completion: continuation.resume(returning:))
decidePolicyForPaymentMenuRedirect(navigationAction: navigationAction, completion: { paymentMenuRedirectPolicy in
Task { @MainActor in
continuation.resume(returning: paymentMenuRedirectPolicy)
}
})
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion SwedbankPaySDK/Classes/WebView/SCAWebViewService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.

import Foundation
import WebKit
@preconcurrency import WebKit

class SCAWebViewService: NSObject, WKNavigationDelegate {
private var handler: ((Result<Void, Error>) -> Void)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.

import Foundation
import WebKit
@preconcurrency import WebKit

final class SwedbankPayExtraWebViewController: SwedbankPayWebViewControllerBase {
override init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.

import UIKit
import WebKit
@preconcurrency import WebKit

class SwedbankPaySCAWebViewController: UIViewController {
internal var lastRootPage: (navigation: WKNavigation?, baseURL: URL?)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.

import UIKit
import WebKit
@preconcurrency import WebKit

class SwedbankPayWebViewController: SwedbankPayWebViewControllerBase {
internal static let maybeStuckNoteMinimumIntervalFromDidBecomeActive = 3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.

import UIKit
import WebKit
@preconcurrency import WebKit

class SwedbankPayWebViewControllerBase: UIViewController {
weak var delegate: SwedbankPayWebViewControllerDelegate?
Expand Down
2 changes: 1 addition & 1 deletion SwedbankPaySDKMerchantBackend.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ a backend server that implements the Merchant Backend API.
s.author = 'Swedbank Pay'
s.source = { :git => 'https://github.com/SwedbankPay/swedbank-pay-sdk-ios.git', :tag => s.version.to_s }

s.ios.deployment_target = '10.0'
s.ios.deployment_target = '11.0'
s.swift_versions = '5.0', '5.1'

s.dependency 'SwedbankPaySDK', s.version.to_s
Expand Down

0 comments on commit c792773

Please sign in to comment.