Skip to content

Commit

Permalink
change api from getSDKconfig to getIds
Browse files Browse the repository at this point in the history
  • Loading branch information
sagishm committed Aug 1, 2021
1 parent a3218f7 commit 6b30794
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions GigyaSwift/Global/Api/ApiService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion GigyaSwift/Global/PersistenceService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion GigyaSwift/Models/Config/GigyaDefinitions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion GigyaSwift/Models/Config/InitSdkResponseModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ struct InitSdkResponseModel: Codable {

struct InitSdkIdsModel: Codable {
let ucid: String
let gmid: String
let gcid: String
}

0 comments on commit 6b30794

Please sign in to comment.