Skip to content

Commit

Permalink
Add secure background delegate. (eu-digital-green-certificates#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
yspreen authored May 20, 2021
1 parent 125a483 commit e060bdb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DGCAVerifier.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifier.dev";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -680,7 +680,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifier.dev";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"repositoryURL": "https://github.com/eu-digital-green-certificates/dgca-app-core-ios",
"state": {
"branch": "main",
"revision": "2e152527072e74e68bfb9b6e22b886ca3636d445",
"revision": "98c54595046e40068b570b69bd04a15668874569",
"version": null
}
},
Expand Down
5 changes: 5 additions & 0 deletions DGCAVerifier/Services/SecureBackground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ struct SecureBackground {
static var imageView: UIImageView?
public static var image: UIImage?

public static var paused = false

public static func enable() {
disable()
guard !paused else {
return
}
guard let image = image else {
return
}
Expand Down
8 changes: 8 additions & 0 deletions DGCAVerifier/ViewControllers/Scan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ class ScanVC: SwiftDGC.ScanVC {
}

extension ScanVC: ScanVCDelegate {
func disableBackgroundDetection() {
SecureBackground.paused = true
}

func enableBackgroundDetection() {
SecureBackground.paused = false
}

func hCertScanned(_ cert: HCert) {
presentViewer(for: cert)
}
Expand Down

0 comments on commit e060bdb

Please sign in to comment.