Skip to content

Commit

Permalink
Merge pull request #79 from SAP/pre-release-1.6.0
Browse files Browse the repository at this point in the history
Pre release 1.6.0
  • Loading branch information
sagishm authored Mar 27, 2024
2 parents 2c612f9 + 7b0e39f commit 6e99479
Show file tree
Hide file tree
Showing 17 changed files with 141 additions and 28 deletions.
10 changes: 6 additions & 4 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.10'
spec.version = '1.6.0'
spec.license = 'Apache 2.0'
spec.homepage = 'https://developers.gigya.com/display/GD/Swift+SDK'
spec.author = 'Gigya SAP'
Expand All @@ -10,15 +10,17 @@ Pod::Spec.new do |spec|
your Swift application
DESC

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

# spec.platform = :ios
spec.ios.deployment_target = '10.0'
spec.ios.deployment_target = '11.0'

spec.source_files = 'GigyaSwift/*/*.swift', 'GigyaSwift/*/*/*.swift', 'GigyaSwift/*/*/*/*.swift', 'GigyaSwift/*/*/*/*/*.swift'

spec.resource_bundle = {
"Gigya_Privacy" => "GigyaSwift/PrivacyInfo.xcprivacy"
}
spec.framework = 'SystemConfiguration'
spec.library = 'c++', 'z'

Expand Down
23 changes: 23 additions & 0 deletions GigyaAuth/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
</dict>
</plist>
30 changes: 17 additions & 13 deletions GigyaSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@
E713E0FE2248C83D00181328 /* GigyaConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = E713E0FD2248C83D00181328 /* GigyaConfig.swift */; };
E713E1022248E41400181328 /* GigyaRequestSignature.swift in Sources */ = {isa = PBXBuildFile; fileRef = E713E1012248E41400181328 /* GigyaRequestSignature.swift */; };
E713E18C224A2E5800181328 /* NetworkAdapterMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = E713E18B224A2E5800181328 /* NetworkAdapterMock.swift */; };
E71611F02B54077C0054D4B7 /* App.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82328BB55240035DDEA /* App.xcframework */; };
E71611F12B54077C0054D4B7 /* App.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82328BB55240035DDEA /* App.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E71611F22B54077C0054D4B7 /* Flutter.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82428BB55240035DDEA /* Flutter.xcframework */; };
E71611F32B54077C0054D4B7 /* Flutter.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E732A82428BB55240035DDEA /* Flutter.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E719373622D32FB800CD149E /* BiometricService.swift in Sources */ = {isa = PBXBuildFile; fileRef = E719373522D32FB800CD149E /* BiometricService.swift */; };
E719373822D33F1F00CD149E /* BiometricServiceInternalProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E719373722D33F1F00CD149E /* BiometricServiceInternalProtocol.swift */; };
E719373A22D33F3700CD149E /* BiometricServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E719373922D33F3700CD149E /* BiometricServiceProtocol.swift */; };
Expand Down Expand Up @@ -107,6 +103,7 @@
E7337467226C538300ADEDBB /* DecodeTestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7337466226C538300ADEDBB /* DecodeTestUtils.swift */; };
E735C2F822B7DBF7007A055E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E735C2F722B7DBF7007A055E /* GoogleService-Info.plist */; };
E73A930222F974120004F93E /* Notification.Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = E73A930122F974120004F93E /* Notification.Name.swift */; };
E73F8BD52B9F4BB100E11B48 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = E73F8BD42B9EF71400E11B48 /* PrivacyInfo.xcprivacy */; };
E741B4CD271420AB00BF693F /* SsoLoginWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E741B4CC271420AA00BF693F /* SsoLoginWrapper.swift */; };
E741DCE12771DDF400E46223 /* TestSsoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = E741DCE02771DDF400E46223 /* TestSsoApp.swift */; };
E741DCE32771DDF400E46223 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E741DCE22771DDF400E46223 /* ContentView.swift */; };
Expand Down Expand Up @@ -166,6 +163,10 @@
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 @@ -318,9 +319,9 @@
E76B94F8285089D100E63E3B /* GigyaAuth.framework in Embed Frameworks */,
E732A83028BB62720035DDEA /* (null) in Embed Frameworks */,
E7A5329A2AE7B039005F3662 /* GigyaTfa.xcframework in Embed Frameworks */,
E71611F32B54077C0054D4B7 /* Flutter.xcframework in Embed Frameworks */,
E7B16EAF2BA045EE005DD81E /* Flutter.xcframework in Embed Frameworks */,
E76B94FA285089EF00E63E3B /* GigyaNss.framework in Embed Frameworks */,
E71611F12B54077C0054D4B7 /* App.xcframework in Embed Frameworks */,
E7B16EAD2BA045EE005DD81E /* App.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -438,6 +439,7 @@
E73C8A412430F69F0064EFE1 /* GigyaNssEngine.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GigyaNssEngine.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E73C8A442430F6B60064EFE1 /* GigyaNssEngine.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GigyaNssEngine.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E73C8A472430F6BB0064EFE1 /* GigyaNss.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GigyaNss.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E73F8BD42B9EF71400E11B48 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
E741B4CC271420AA00BF693F /* SsoLoginWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SsoLoginWrapper.swift; sourceTree = "<group>"; };
E741DCBC2770F72F00E46223 /* GigyaTfa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GigyaTfa.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E741DCBF2770F79B00E46223 /* GigyaTfa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GigyaTfa.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -682,11 +684,11 @@
files = (
E7DC2C6D2280778000A13426 /* libc++.tbd in Frameworks */,
E7DC2C6C2280771700A13426 /* libz.tbd in Frameworks */,
E71611F02B54077C0054D4B7 /* App.xcframework in Frameworks */,
E7B16EAC2BA045EE005DD81E /* App.xcframework in Frameworks */,
E7A532992AE7B039005F3662 /* GigyaTfa.xcframework in Frameworks */,
E76B94F7285089D100E63E3B /* GigyaAuth.framework in Frameworks */,
E76B94F9285089EF00E63E3B /* GigyaNss.framework in Frameworks */,
E71611F22B54077C0054D4B7 /* Flutter.xcframework in Frameworks */,
E7B16EAE2BA045EE005DD81E /* Flutter.xcframework in Frameworks */,
E7DC2C6B228076E600A13426 /* libsqlite3.tbd in Frameworks */,
E73373F522633BDA00ADEDBB /* SafariServices.framework in Frameworks */,
E731B72D232A53AD0032E111 /* AuthenticationServices.framework in Frameworks */,
Expand Down Expand Up @@ -1148,6 +1150,7 @@
E7CBB03E223561A8000B6C11 /* Gigya */,
E7BE36772224219200A108D9 /* Info.plist */,
E7BE36762224219200A108D9 /* GigyaSwift.h */,
E73F8BD42B9EF71400E11B48 /* PrivacyInfo.xcprivacy */,
E7818A6B222445F8008117AB /* Config.xcconfig */,
);
path = GigyaSwift;
Expand Down Expand Up @@ -1788,6 +1791,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E73F8BD52B9F4BB100E11B48 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1860,7 +1864,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# set framework folder name\nFRAMEWORK_FOLDER_NAME=\"${PROJECT_NAME}_XCFramework\"\n# set framework name or read it from project by this variable\nFRAMEWORK_NAME=\"GigyaSwift.xcworkspace\"\nFRAMEWORK_SCHEMA=\"Gigya\"\n\n#xcframework path\nFRAMEWORK_PATH=\"${PROJECT_DIR}/XC/${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_SCHEMA}.xcframework\"\n# set path for iOS simulator archive\nSIMULATOR_ARCHIVE_PATH=\"${PROJECT_DIR}/${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive\"\n# set path for iOS device archive\nIOS_DEVICE_ARCHIVE_PATH=\"${PROJECT_DIR}/${FRAMEWORK_FOLDER_NAME}/iOS.xcarchive\"\nrm -rf \"${PROJECT_DIR}/XC/${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_SCHEMA}\"\necho \"Deleted ${FRAMEWORK_FOLDER_NAME}\"\nmkdir \"${FRAMEWORK_FOLDER_NAME}\"\necho \"Created ${FRAMEWORK_FOLDER_NAME}\"\necho \"Archiving ${FRAMEWORK_NAME}\"\n\nxcodebuild archive -workspace \"${FRAMEWORK_NAME}\" -scheme ${FRAMEWORK_SCHEMA} -destination=\"iOS Simulator\" -archivePath \"${SIMULATOR_ARCHIVE_PATH}\" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES\n\nxcodebuild archive -workspace \"${FRAMEWORK_NAME}\" -scheme ${FRAMEWORK_SCHEMA} -destination=\"iOS\" -archivePath \"${IOS_DEVICE_ARCHIVE_PATH}\" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES\n#Creating XCFramework\nxcodebuild -create-xcframework -framework ${SIMULATOR_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_SCHEMA}.framework -framework ${IOS_DEVICE_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_SCHEMA}.framework -output \"${FRAMEWORK_PATH}\"\nrm -rf \"${SIMULATOR_ARCHIVE_PATH}\"\nrm -rf \"${IOS_DEVICE_ARCHIVE_PATH}\"\nopen \"${PROJECT_DIR}/XC/${FRAMEWORK_FOLDER_NAME}\"\n\n/opt/homebrew/bin/go run \"${PROJECT_DIR}/XC/fixer/fixer.go\" \"${FRAMEWORK_PATH}\"\n";
shellScript = "# set framework folder name\nFRAMEWORK_FOLDER_NAME=\"${PROJECT_NAME}_XCFramework\"\n# set framework name or read it from project by this variable\nFRAMEWORK_NAME=\"GigyaSwift.xcworkspace\"\nFRAMEWORK_SCHEMA=\"Gigya\"\n\n#xcframework path\nFRAMEWORK_PATH=\"${PROJECT_DIR}/XC/${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_SCHEMA}.xcframework\"\n# set path for iOS simulator archive\nSIMULATOR_ARCHIVE_PATH=\"${PROJECT_DIR}/${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive\"\n# set path for iOS device archive\nIOS_DEVICE_ARCHIVE_PATH=\"${PROJECT_DIR}/${FRAMEWORK_FOLDER_NAME}/iOS.xcarchive\"\nrm -rf \"${PROJECT_DIR}/XC/${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_SCHEMA}\"\necho \"Deleted ${FRAMEWORK_FOLDER_NAME}\"\nmkdir \"${FRAMEWORK_FOLDER_NAME}\"\necho \"Created ${FRAMEWORK_FOLDER_NAME}\"\necho \"Archiving ${FRAMEWORK_NAME}\"\n\nxcodebuild archive -workspace \"${FRAMEWORK_NAME}\" -scheme ${FRAMEWORK_SCHEMA} -destination=\"iOS Simulator\" -archivePath \"${SIMULATOR_ARCHIVE_PATH}\" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES\n\nxcodebuild archive -workspace \"${FRAMEWORK_NAME}\" -scheme ${FRAMEWORK_SCHEMA} -destination=\"iOS\" -archivePath \"${IOS_DEVICE_ARCHIVE_PATH}\" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES\n#Creating XCFramework\nxcodebuild -create-xcframework -framework ${SIMULATOR_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_SCHEMA}.framework -framework ${IOS_DEVICE_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_SCHEMA}.framework -output \"${FRAMEWORK_PATH}\"\ncodesign --timestamp -v --sign \"Apple Development: Sagi Shmuel (M54M22QGDP)\" ${FRAMEWORK_NAME}.xcframework\n\nrm -rf \"${SIMULATOR_ARCHIVE_PATH}\"\nrm -rf \"${IOS_DEVICE_ARCHIVE_PATH}\"\nopen \"${PROJECT_DIR}/XC/${FRAMEWORK_FOLDER_NAME}\"\n\n/opt/homebrew/bin/go run \"${PROJECT_DIR}/XC/fixer/fixer.go\" \"${FRAMEWORK_PATH}\"\n";
};
EB7918E424CC7E8B9A7E4C27 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -2579,7 +2583,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development: Sagi Shmuel (M54M22QGDP)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 140;
DEFINES_MODULE = YES;
Expand All @@ -2601,7 +2605,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.5.10;
MARKETING_VERSION = 1.6.0;
MODULEMAP_FILE = "";
MODULEMAP_PRIVATE_FILE = "";
ONLY_ACTIVE_ARCH = NO;
Expand Down Expand Up @@ -2640,7 +2644,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development: Sagi Shmuel (M54M22QGDP)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 140;
DEFINES_MODULE = YES;
Expand All @@ -2662,7 +2666,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.5.10;
MARKETING_VERSION = 1.6.0;
MODULEMAP_FILE = "";
MODULEMAP_PRIVATE_FILE = "";
ONLY_ACTIVE_ARCH = NO;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>
2 changes: 1 addition & 1 deletion GigyaSwift/Gigya/GigyaCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public final class GigyaCore<T: GigyaAccountProtocol>: GigyaInstanceProtocol {
public func isLoggedIn() -> Bool {
return sessionService.isValidSession()
}

/**
Set session.
Expand Down
7 changes: 6 additions & 1 deletion GigyaSwift/Global/Api/ApiService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ final class ApiService: ApiServiceProtocol {

func getSDKConfig() {
persistenceService.isStartSdk = true


if let refreshTime = persistenceService.idsRefreshTime,
refreshTime > Date().millisecondsSince1970 {
return
}

let params = ["include": "permissions,ids,appIds"]
let model = ApiRequestModel(method: GigyaDefinitions.API.getSdkConfig, params: params)

Expand Down
4 changes: 2 additions & 2 deletions GigyaSwift/Global/Api/BusinessApiService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class BusinessApiService: NSObject, BusinessApiServiceProtocol {
let regToken = data["regToken"]?.value ?? ""
let makeParams: [String: Any] = ["email": email, "password": password, "regToken": regToken, "finalizeRegistration": "true"].merging(params) { $1 }

let model = ApiRequestModel(method: GigyaDefinitions.API.register, params: makeParams)
let model = ApiRequestModel(method: GigyaDefinitions.API.register, params: makeParams, config: self?.config)

self?.apiService.send(model: model, responseType: T.self) { result in
switch result {
Expand Down Expand Up @@ -232,7 +232,7 @@ class BusinessApiService: NSObject, BusinessApiServiceProtocol {
var params: [String: Any] = params
params["loginID"] = UID

let model = ApiRequestModel(method: GigyaDefinitions.API.verifyLogin, params: params)
let model = ApiRequestModel(method: GigyaDefinitions.API.verifyLogin, params: params, config: config)

apiService.send(model: model, responseType: T.self) { result in
switch result {
Expand Down
7 changes: 7 additions & 0 deletions GigyaSwift/Global/PersistenceService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public final class PersistenceService {
return UserDefaults.standard.string(forKey: InternalConfig.Storage.UCID)
}
}

internal var idsRefreshTime: Double? {
get {
return UserDefaults.standard.double(forKey: InternalConfig.Storage.idsRefreshTime)
}
}

internal var hasRunBefore: Bool? {
get {
Expand Down Expand Up @@ -74,6 +80,7 @@ public final class PersistenceService {
internal func save(ids: InitSdkIdsModel) {
UserDefaults.standard.setValue(ids.gcid, forKey: InternalConfig.Storage.GMID)
UserDefaults.standard.setValue(ids.ucid, forKey: InternalConfig.Storage.UCID)
UserDefaults.standard.setValue(ids.refreshTime, forKey: InternalConfig.Storage.idsRefreshTime)
}

internal func setBiometricEnable(to allow: Bool) {
Expand Down
4 changes: 2 additions & 2 deletions GigyaSwift/Global/Session/SessionService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class SessionService: SessionServiceProtocol {
gsession.sessionExpirationTimestamp = sessionExpirationTimestamp
}

let data = NSKeyedArchiver.archivedData(withRootObject: gsession)
let data = try? NSKeyedArchiver.archivedData(withRootObject: gsession, requiringSecureCoding: true)

self?.keychainHelper.add(with: InternalConfig.Storage.keySession, data: data) { [weak self] err in
GigyaLogger.log(with: self, message: "[setSession]: \(err)")
Expand Down Expand Up @@ -182,7 +182,7 @@ class SessionService: SessionServiceProtocol {
func setSessionAs(biometric: Bool, completion: @escaping (GigyaBiometricResult) -> Void) {
guard let session = session else { return }

let data = NSKeyedArchiver.archivedData(withRootObject: session)
let data = try? NSKeyedArchiver.archivedData(withRootObject: session, requiringSecureCoding: true)

var mode: KeychainMode = .regular

Expand Down
1 change: 1 addition & 0 deletions GigyaSwift/Global/Session/SessionVerificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class SessionVerificationService: SessionVerificationServiceProtocol {
}
})
})
sessionLifeCountdownTimer?.fire()
}

func stop() {
Expand Down
6 changes: 6 additions & 0 deletions GigyaSwift/Global/Utils/GeneralUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,9 @@ extension Data {
return self.base64EncodedString().replacingOccurrences(of: "+", with: "-").replacingOccurrences(of: "/", with: "_").replacingOccurrences(of: "=", with: "")
}
}

extension Date {
internal var millisecondsSince1970: Double {
Double((self.timeIntervalSince1970 * 1000.0).rounded())
}
}
1 change: 1 addition & 0 deletions GigyaSwift/Models/Config/InitSdkResponseModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ struct InitSdkResponseModel: Codable {
struct InitSdkIdsModel: Codable {
let ucid: String
let gcid: String
let refreshTime: Double?
}
Loading

0 comments on commit 6e99479

Please sign in to comment.