From a7c23d08a3b40fa18244048e092e21e0f74fa78f Mon Sep 17 00:00:00 2001 From: Osama Rabie <59433049+OsamaRabie@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:15:23 +0300 Subject: [PATCH] Issue in RN when app moves to BG loses connectivity --- goSellSDK.podspec | 2 +- goSellSDK/Core/UI/Internal/Data/ErrorDataManager.swift | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/goSellSDK.podspec b/goSellSDK.podspec index 57f250e5..231ebd9f 100644 --- a/goSellSDK.podspec +++ b/goSellSDK.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |goSellSDK| goSellSDK.name = 'goSellSDK' goSellSDK.summary = 'goSell SDK for iOS' goSellSDK.requires_arc = true - goSellSDK.version = '2.3.31' + goSellSDK.version = '2.3.32' goSellSDK.license = { :type => 'MIT', :file => 'LICENSE' } goSellSDK.author = { 'Tap Payments' => 'hello@tap.company' } goSellSDK.homepage = 'https://github.com/Tap-Payments/goSellSDK-iOS' diff --git a/goSellSDK/Core/UI/Internal/Data/ErrorDataManager.swift b/goSellSDK/Core/UI/Internal/Data/ErrorDataManager.swift index e24e4f6c..f7f281db 100644 --- a/goSellSDK/Core/UI/Internal/Data/ErrorDataManager.swift +++ b/goSellSDK/Core/UI/Internal/Data/ErrorDataManager.swift @@ -178,8 +178,12 @@ internal class ErrorDataManager { #endif if action.contains(.retry) { - - ErrorActionExecutor.showAlert(for: error, with: alertTitle, message: alertMessage, retryAction: retryAction, report: report, completion: localCompletion) + let state = UIApplication.shared.applicationState + if (state == .background || state == .inactive) && error.type == .network { + retryAction?() + }else { + ErrorActionExecutor.showAlert(for: error, with: alertTitle, message: alertMessage, retryAction: retryAction, report: report, completion: localCompletion) + } } else {