Skip to content

Commit

Permalink
Merge for release 1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sagishm committed May 30, 2024
1 parent 61d5fc4 commit c44703b
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 16 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.6.1'
spec.version = '1.6.2'
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.6.1' }
spec.source = { :git => 'https://github.com/SAP/gigya-swift-sdk.git', :tag => 'core/v1.6.2' }
spec.module_name = 'Gigya'
spec.swift_version = '5.3'

Expand Down
20 changes: 10 additions & 10 deletions GigyaSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
E760668C2278998E005E4CFD /* WebViewWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E76066892278998E005E4CFD /* WebViewWrapper.swift */; };
E760668D2278998E005E4CFD /* GigyaWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E760668A2278998E005E4CFD /* GigyaWebViewController.swift */; };
E76421DF25E2BFEB00CDED4C /* ApiRequestModel+GlobalConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = E76421DE25E2BFEB00CDED4C /* ApiRequestModel+GlobalConfig.swift */; };
E76A94C12BFF6E9A00862A4B /* App.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82328BB55240035DDEA /* App.xcframework */; };
E76A94C22BFF6E9A00862A4B /* App.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82328BB55240035DDEA /* App.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E76A94C32BFF6E9A00862A4B /* Flutter.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82428BB55240035DDEA /* Flutter.xcframework */; };
E76A94C42BFF6E9A00862A4B /* Flutter.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82428BB55240035DDEA /* Flutter.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E76AF6EB24C88BA8008B9114 /* ApiService.swift in Sources */ = {isa = PBXBuildFile; fileRef = E76AF6EA24C88BA8008B9114 /* ApiService.swift */; };
E76B94F7285089D100E63E3B /* GigyaAuth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E779232526A04F1E00446A7F /* GigyaAuth.framework */; };
E76B94F8285089D100E63E3B /* GigyaAuth.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E779232526A04F1E00446A7F /* GigyaAuth.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -163,10 +167,6 @@
E7ACF9AE226C843100900C65 /* SessionServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7ACF9AD226C843100900C65 /* SessionServiceProtocol.swift */; };
E7ACF9B0226C844A00900C65 /* AccountServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7ACF9AF226C844A00900C65 /* AccountServiceProtocol.swift */; };
E7ACF9CC226F2A4100900C65 /* ProviderWrapperProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7ACF9CB226F2A4100900C65 /* ProviderWrapperProtocol.swift */; };
E7B16EAC2BA045EE005DD81E /* App.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82328BB55240035DDEA /* App.xcframework */; };
E7B16EAD2BA045EE005DD81E /* App.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82328BB55240035DDEA /* App.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E7B16EAE2BA045EE005DD81E /* Flutter.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82428BB55240035DDEA /* Flutter.xcframework */; };
E7B16EAF2BA045EE005DD81E /* Flutter.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82428BB55240035DDEA /* Flutter.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E7B2FA9525F0FAF6002A7010 /* GigyaSchema.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7B2FA9425F0FAF6002A7010 /* GigyaSchema.swift */; };
E7B4D69C238329F50090E57D /* PushNotificationsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = E720D34B2382D32300446EA4 /* PushNotificationsService.swift */; };
E7B5408A23952E2200C0C8D8 /* UserNotificationCenterProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7B5408923952E2200C0C8D8 /* UserNotificationCenterProtocol.swift */; };
Expand Down Expand Up @@ -319,9 +319,9 @@
E76B94F8285089D100E63E3B /* GigyaAuth.framework in Embed Frameworks */,
E732A83028BB62720035DDEA /* (null) in Embed Frameworks */,
E7A5329A2AE7B039005F3662 /* GigyaTfa.xcframework in Embed Frameworks */,
E7B16EAF2BA045EE005DD81E /* Flutter.xcframework in Embed Frameworks */,
E76A94C42BFF6E9A00862A4B /* Flutter.xcframework in Embed Frameworks */,
E76B94FA285089EF00E63E3B /* GigyaNss.framework in Embed Frameworks */,
E7B16EAD2BA045EE005DD81E /* App.xcframework in Embed Frameworks */,
E76A94C22BFF6E9A00862A4B /* App.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -684,11 +684,11 @@
files = (
E7DC2C6D2280778000A13426 /* libc++.tbd in Frameworks */,
E7DC2C6C2280771700A13426 /* libz.tbd in Frameworks */,
E7B16EAC2BA045EE005DD81E /* App.xcframework in Frameworks */,
E76A94C12BFF6E9A00862A4B /* App.xcframework in Frameworks */,
E7A532992AE7B039005F3662 /* GigyaTfa.xcframework in Frameworks */,
E76B94F7285089D100E63E3B /* GigyaAuth.framework in Frameworks */,
E76B94F9285089EF00E63E3B /* GigyaNss.framework in Frameworks */,
E7B16EAE2BA045EE005DD81E /* Flutter.xcframework in Frameworks */,
E76A94C32BFF6E9A00862A4B /* Flutter.xcframework in Frameworks */,
E7DC2C6B228076E600A13426 /* libsqlite3.tbd in Frameworks */,
E73373F522633BDA00ADEDBB /* SafariServices.framework in Frameworks */,
E731B72D232A53AD0032E111 /* AuthenticationServices.framework in Frameworks */,
Expand Down Expand Up @@ -2605,7 +2605,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.2;
MODULEMAP_FILE = "";
MODULEMAP_PRIVATE_FILE = "";
ONLY_ACTIVE_ARCH = NO;
Expand Down Expand Up @@ -2666,7 +2666,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.2;
MODULEMAP_FILE = "";
MODULEMAP_PRIVATE_FILE = "";
ONLY_ACTIVE_ARCH = NO;
Expand Down
Binary file not shown.
18 changes: 18 additions & 0 deletions GigyaSwift/Gigya/GigyaCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ public final class GigyaCore<T: GigyaAccountProtocol>: GigyaInstanceProtocol {
}

// MARK: Global methods

public func getAuthCode(completion: @escaping (GigyaApiResult<String>) -> Void) {
businessApiService.getAuthCode(completion: completion)
}

/**
Register Social Provider without reflection.
Expand Down Expand Up @@ -712,5 +716,19 @@ public extension GigyaCore {
}
})
}

func getAuthCode() async throws -> String {
return try await withCheckedThrowingContinuation({
(continuation: CheckedContinuation<String, Error>) in
self.getAuthCode() { result in
switch result {
case .success(data: let data):
continuation.resume(returning: data)
case .failure(let error):
continuation.resume(throwing: error)
}
}
})
}

}
23 changes: 21 additions & 2 deletions GigyaSwift/Global/Api/BusinessApiService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class BusinessApiService: NSObject, BusinessApiServiceProtocol {
}

func register<T: GigyaAccountProtocol>(email: String, password: String, params: [String: Any], dataType: T.Type, completion: @escaping (GigyaLoginResult<T>) -> Void) {
let model = ApiRequestModel(method: GigyaDefinitions.API.initRegistration)
let model = ApiRequestModel(method: GigyaDefinitions.API.initRegistration, config: config)

apiService.send(model: model, responseType: [String: AnyCodable].self) { [weak self] (result) in
switch result {
Expand Down Expand Up @@ -158,7 +158,7 @@ class BusinessApiService: NSObject, BusinessApiServiceProtocol {
}

func login<T: GigyaAccountProtocol>(params: [String: Any], completion: @escaping (GigyaLoginResult<T>) -> Void) {
let model = ApiRequestModel(method: GigyaDefinitions.API.login, params: params)
let model = ApiRequestModel(method: GigyaDefinitions.API.login, params: params, config: config)

apiService.send(model: model, responseType: T.self) { [weak self] result in
switch result {
Expand Down Expand Up @@ -373,6 +373,25 @@ class BusinessApiService: NSObject, BusinessApiServiceProtocol {
}
}
}

func getAuthCode(completion: @escaping (GigyaApiResult<String>) -> Void) {
let params = ["resource": "urn:gigya:account",
"subject_token_type": "urn:gigya:token-type:mobile",
"response_type": "code"
]
let model = ApiRequestModel(method: "accounts.identity.token.exchange", params: params)

apiService.send(model: model, responseType: GigyaDictionary.self) { result in
switch result {
case .success(let data):
let code = data["code"]?.value as? String ?? ""
completion(.success(data: code))
case .failure(let error):
completion(.failure(error))
}
}

}

// MARK: - Internal methods

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 @@ -69,5 +69,7 @@ public protocol BusinessApiServiceProtocol {
func getSchema(params: [String: Any], completion: @escaping (GigyaApiResult<GigyaSchema>) -> Void)

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

func getAuthCode(completion: @escaping (GigyaApiResult<String>) -> Void)

}
2 changes: 1 addition & 1 deletion GigyaSwift/Global/Plugins/GigyaWebBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ open class GigyaWebBridge<T: GigyaAccountProtocol>: NSObject, WKScriptMessageHan
/**
Delegate received plugin events to client.
*/
private func onPluginEvent<T>(type: T.Type, params: [String: String]) {
private func onPluginEvent<B>(type: B.Type, params: [String: String]) {
if let eventName = params["eventName"] {
switch eventName {
case "beforeScreenLoad":
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.6.1"
internal static let version = "\(GigyaDefinitions.versionPrefix ?? "")ios_swift_1.6.2"
internal static let sdkDomain = "com.gigya.GigyaSDK"
internal static let defaultLang = "en"
}
Expand Down

0 comments on commit c44703b

Please sign in to comment.