Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sagishm committed Aug 15, 2023
2 parents ca34107 + cc16eea commit fa01ac7
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Gigya.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'Gigya'
spec.version = '1.5.4'
spec.version = '1.5.5'
spec.license = 'Apache 2.0'
spec.homepage = 'https://developers.gigya.com/display/GD/Swift+SDK'
spec.author = 'Gigya SAP'
Expand All @@ -10,7 +10,7 @@ Pod::Spec.new do |spec|
your Swift application
DESC

spec.source = { :git => 'https://github.com/SAP/gigya-swift-sdk.git', :tag => 'core/v1.5.4' }
spec.source = { :git => 'https://github.com/SAP/gigya-swift-sdk.git', :tag => 'core/v1.5.5' }
spec.module_name = 'Gigya'
spec.swift_version = '5.3'

Expand Down
12 changes: 12 additions & 0 deletions GigyaNss/Flutter/Debug/App.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>App.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
Expand Down
4 changes: 2 additions & 2 deletions GigyaSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2590,7 +2590,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.5.4;
MARKETING_VERSION = 1.5.5;
MODULEMAP_FILE = "";
MODULEMAP_PRIVATE_FILE = "";
ONLY_ACTIVE_ARCH = NO;
Expand Down Expand Up @@ -2651,7 +2651,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.5.4;
MARKETING_VERSION = 1.5.5;
MODULEMAP_FILE = "";
MODULEMAP_PRIVATE_FILE = "";
ONLY_ACTIVE_ARCH = NO;
Expand Down
11 changes: 11 additions & 0 deletions GigyaSwift/Gigya/GigyaCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,17 @@ public final class GigyaCore<T: GigyaAccountProtocol>: GigyaInstanceProtocol {
businessApiService.removeConnection(providerName: provider, completion: completion)
}

/**
Remove a social connection from current account.
- Parameter params: Request parameters.
- Parameter completion: Login response `GigyaApiResult<GigyaDictionary>`.
*/

public func removeConnection(params: [String: Any] = [:], completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void) {
businessApiService.removeConnection(params: params, completion: completion)
}

/**
Get Schema api.
Expand Down
8 changes: 8 additions & 0 deletions GigyaSwift/Global/Api/BusinessApiService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ class BusinessApiService: NSObject, BusinessApiServiceProtocol {
}
}

func removeConnection(params: [String: Any], completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void) {
GigyaLogger.log(with: self, message: "[removeConnection]: params: \(params)")

let model = ApiRequestModel(method: GigyaDefinitions.API.removeConnection, params: params)
apiService.send(model: model, responseType: GigyaDictionary.self, completion: completion)
}

func removeConnection(providerName: GigyaSocialProviders, completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void) {
let params = ["provider": providerName.rawValue]

Expand All @@ -287,6 +294,7 @@ class BusinessApiService: NSObject, BusinessApiServiceProtocol {
let model = ApiRequestModel(method: GigyaDefinitions.API.logout, params: [:])
apiService.send(model: model, responseType: GigyaDictionary.self) { [weak self] result in
self?.sessionService.clear()
self?.sessionService.clearCookies()
self?.biometricService.clearBiometric()

switch result {
Expand Down
2 changes: 2 additions & 0 deletions GigyaSwift/Global/Api/BusinessApiServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ protocol BusinessApiServiceProtocol {

func addConnection<T: GigyaAccountProtocol>(provider: GigyaSocialProviders, viewController: UIViewController, params: [String: Any], dataType: T.Type, completion: @escaping (GigyaApiResult<T>) -> Void)

func removeConnection(params: [String: Any], completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void)

func removeConnection(providerName: GigyaSocialProviders, completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void)

func logout(completion: @escaping (GigyaApiResult<GigyaDictionary>) -> Void)
Expand Down
9 changes: 7 additions & 2 deletions GigyaSwift/Global/Plugins/GigyaWebBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ final public class GigyaWebBridge<T: GigyaAccountProtocol>: NSObject, WKScriptMe
}

GigyaLogger.log(with: self, message: "JS Interface:\n\(JSInterface)")

if #available(iOS 16.4, *), GigyaLogger.isDebug() {
self.webView?.isInspectable = true
}

}

func load(html: String) {
Expand Down Expand Up @@ -372,8 +377,8 @@ final public class GigyaWebBridge<T: GigyaAccountProtocol>: NSObject, WKScriptMe
private func sendRemoveConnectionRequest(callbackId: String, params: [String: String]) {
GigyaLogger.log(with: self, message: "sendRemoveConnectionRequest: with params:\n\(params)")

if let provider = params["provider"], let providerType = GigyaSocialProviders(rawValue: provider) {
businessApiService.removeConnection(providerName: providerType) { [weak self] result in
if let provider = params["provider"], let _ = GigyaSocialProviders(rawValue: provider) {
businessApiService.removeConnection(params: params) { [weak self] result in
guard let self = self else { return }
switch result {
case .success(let data):
Expand Down
5 changes: 1 addition & 4 deletions GigyaSwift/Global/Session/SessionService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,6 @@ class SessionService: SessionServiceProtocol {
// clear account from cach
accountService.clear()

// clear all cookies created in WKWebView
clearCookies()

// clear session from memory
self.session = nil
}
Expand All @@ -317,7 +314,7 @@ class SessionService: SessionServiceProtocol {
}
}

private func clearCookies() {
func clearCookies() {
if clearCookiesEnable {
DispatchQueue.main.async {
HTTPCookieStorage.shared.removeCookies(since: .distantPast)
Expand Down
2 changes: 2 additions & 0 deletions GigyaSwift/Global/Session/SessionServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public protocol SessionServiceProtocol {
func clear(completion: @escaping () -> Void)

func clearSession()

func clearCookies()

func setClearCookies(to value: Bool)

Expand Down
2 changes: 1 addition & 1 deletion GigyaSwift/Models/Config/InternalConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

struct InternalConfig {
struct General {
internal static let version = "\(GigyaDefinitions.versionPrefix ?? "")ios_swift_1.5.4"
internal static let version = "\(GigyaDefinitions.versionPrefix ?? "")ios_swift_1.5.5"
internal static let sdkDomain = "com.gigya.GigyaSDK"
internal static let defaultLang = "en"
}
Expand Down
4 changes: 3 additions & 1 deletion GigyaSwiftTests/Services/SessionServiceMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ class SessionServiceMock: SessionServiceProtocol {

}


func clearCookies() {

}
}

0 comments on commit fa01ac7

Please sign in to comment.