From d50b526c5ed0b6bb23a5e79ffd691d2fec819b07 Mon Sep 17 00:00:00 2001
From: ahmadAlfhajri <82349749+ahmadAlfhajri@users.noreply.github.com>
Date: Tue, 24 Dec 2024 12:24:37 +0800
Subject: [PATCH 1/2] Fix memory leak on WebViewController
---
.../WebViewController/AuthenticationWebviewController.swift | 4 ++--
Sources/Xendit/WebViewController/WebViewController.swift | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Sources/Xendit/WebViewController/AuthenticationWebviewController.swift b/Sources/Xendit/WebViewController/AuthenticationWebviewController.swift
index aff770c..b321dfe 100644
--- a/Sources/Xendit/WebViewController/AuthenticationWebviewController.swift
+++ b/Sources/Xendit/WebViewController/AuthenticationWebviewController.swift
@@ -19,8 +19,8 @@ class AuthenticationProvider: AuthenticationProviderProtocol {
func authenticate(fromViewController: UIViewController, URL: String, authentication: XenditAuthentication, completion: @escaping (XenditAuthentication?, XenditError?) -> Void) {
let webViewController = AuthenticationWebViewController(URL: URL)
webViewController.authentication = authentication
- webViewController.authenticateCompletion = { updatedAuthentication, error in
- webViewController.dismiss(animated: true, completion: nil)
+ webViewController.authenticateCompletion = { [weak webViewController] updatedAuthentication, error in
+ webViewController?.dismiss(animated: true, completion: nil)
completion(updatedAuthentication, error)
}
DispatchQueue.main.async {
diff --git a/Sources/Xendit/WebViewController/WebViewController.swift b/Sources/Xendit/WebViewController/WebViewController.swift
index 9a6beee..c32e4a7 100755
--- a/Sources/Xendit/WebViewController/WebViewController.swift
+++ b/Sources/Xendit/WebViewController/WebViewController.swift
@@ -20,8 +20,8 @@ class CardAuthenticationProvider: CardAuthenticationProviderProtocol {
let webViewController = WebViewController(URL: URL)
webViewController.token = authenticatedToken
- webViewController.authenticateCompletion = { (token, error) -> Void in
- webViewController.dismiss(animated: true, completion: nil)
+ webViewController.authenticateCompletion = { [weak webViewController] (token, error) -> Void in
+ webViewController?.dismiss(animated: true, completion: nil)
guard error == nil else {
return completion(nil, error)
}
From 1d8c7e3d4359f1cb70b0698fea563092080f7f2f Mon Sep 17 00:00:00 2001
From: ahmadAlfhajri <82349749+ahmadAlfhajri@users.noreply.github.com>
Date: Tue, 24 Dec 2024 12:30:29 +0800
Subject: [PATCH 2/2] Update version to 3.10.3
---
README.md | 2 +-
Sources/Xendit/Info.plist | 2 +-
Sources/Xendit/XDTApiClient.swift | 2 +-
Xendit.podspec | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 453e452..7bd54f6 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ Note that starting version 3.10.0, it requires minimum version of iOS 11. If you
Add this to your Podfile.
```ruby
-pod 'Xendit', '~> 3.10.2'
+pod 'Xendit', '~> 3.10.3'
```
**Important:** Import SDK in Objective-C project with CocoaPods integration, you can do as following
diff --git a/Sources/Xendit/Info.plist b/Sources/Xendit/Info.plist
index ff9995d..92463dd 100755
--- a/Sources/Xendit/Info.plist
+++ b/Sources/Xendit/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 3.10.2
+ 3.10.3
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
diff --git a/Sources/Xendit/XDTApiClient.swift b/Sources/Xendit/XDTApiClient.swift
index 4139da3..d455616 100644
--- a/Sources/Xendit/XDTApiClient.swift
+++ b/Sources/Xendit/XDTApiClient.swift
@@ -38,7 +38,7 @@ class XDTApiClient {
internal static let CLIENT_TYPE = "SDK";
internal static let CLIENT_API_VERSION = "2.0.0";
internal static let CLIENT_IDENTIFIER = "Xendit iOS SDK";
- internal static let CLIENT_SDK_VERSION = "3.10.2";
+ internal static let CLIENT_SDK_VERSION = "3.10.3";
private static let WEBAPI_FLEX_BASE_URL = "https://sandbox.webapi.visa.com"
diff --git a/Xendit.podspec b/Xendit.podspec
index ea2c34a..4e6c72a 100755
--- a/Xendit.podspec
+++ b/Xendit.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Xendit'
- s.version = '3.10.2'
+ s.version = '3.10.3'
s.license = 'MIT'
s.homepage = 'https://www.xendit.co'
s.author = { 'Juan Gonzalez’' => 'juan@xendit.co' }