From 6b307946502c8a58aa0f205c536fc5310f428efa Mon Sep 17 00:00:00 2001 From: Sagi Date: Sun, 1 Aug 2021 11:14:02 +0300 Subject: [PATCH] change api from getSDKconfig to getIds --- GigyaSwift/Global/Api/ApiService.swift | 4 ++-- GigyaSwift/Global/PersistenceService.swift | 2 +- GigyaSwift/Models/Config/GigyaDefinitions.swift | 2 +- GigyaSwift/Models/Config/InitSdkResponseModel.swift | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GigyaSwift/Global/Api/ApiService.swift b/GigyaSwift/Global/Api/ApiService.swift index dac80f57..9890cb99 100644 --- a/GigyaSwift/Global/Api/ApiService.swift +++ b/GigyaSwift/Global/Api/ApiService.swift @@ -34,10 +34,10 @@ final class ApiService: ApiServiceProtocol { let params = ["include": "permissions,ids,appIds"] let model = ApiRequestModel(method: GigyaDefinitions.API.getSdkConfig, params: params) - self.sendBlocking(model: model, responseType: InitSdkResponseModel.self) { [weak self] result in + self.sendBlocking(model: model, responseType: InitSdkIdsModel.self) { [weak self] result in switch result { case .success(let data): - self?.persistenceService.save(ids: data.ids) + self?.persistenceService.save(ids: data) self?.persistenceService.isInitSdk = true case .failure(let error): self?.reportingService.sendErrorReport(msg: "getSDKConfig error", details: ["details": error.localizedDescription]) diff --git a/GigyaSwift/Global/PersistenceService.swift b/GigyaSwift/Global/PersistenceService.swift index 5417a341..b3df4a92 100644 --- a/GigyaSwift/Global/PersistenceService.swift +++ b/GigyaSwift/Global/PersistenceService.swift @@ -58,7 +58,7 @@ public final class PersistenceService { // save gmid, ucid to userDefaults internal func save(ids: InitSdkIdsModel) { - UserDefaults.standard.setValue(ids.gmid, forKey: InternalConfig.Storage.GMID) + UserDefaults.standard.setValue(ids.gcid, forKey: InternalConfig.Storage.GMID) UserDefaults.standard.setValue(ids.ucid, forKey: InternalConfig.Storage.UCID) } diff --git a/GigyaSwift/Models/Config/GigyaDefinitions.swift b/GigyaSwift/Models/Config/GigyaDefinitions.swift index fca6a872..313ea954 100644 --- a/GigyaSwift/Models/Config/GigyaDefinitions.swift +++ b/GigyaSwift/Models/Config/GigyaDefinitions.swift @@ -11,7 +11,7 @@ import Foundation public struct GigyaDefinitions { public struct API { // MARK: ACCOUNT - public static let getSdkConfig = "socialize.getSDKConfig" + public static let getSdkConfig = "socialize.getIDs" public static let login = "accounts.login" public static let logout = "accounts.logout" public static let getAccountInfo = "accounts.getAccountInfo" diff --git a/GigyaSwift/Models/Config/InitSdkResponseModel.swift b/GigyaSwift/Models/Config/InitSdkResponseModel.swift index 68a6b13b..419eb53b 100644 --- a/GigyaSwift/Models/Config/InitSdkResponseModel.swift +++ b/GigyaSwift/Models/Config/InitSdkResponseModel.swift @@ -14,5 +14,5 @@ struct InitSdkResponseModel: Codable { struct InitSdkIdsModel: Codable { let ucid: String - let gmid: String + let gcid: String }