-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GiniCaptureSDK): Add error screen events
- events added: `screen_shown`, `close_tapped`, `enter_manually_tapped`, `retake_images_tapped` - fix tests PP-392
- Loading branch information
1 parent
ae3e1e3
commit 0bae068
Showing
11 changed files
with
170 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Tracking/AnalyticsMapper.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// AnalyticsMapper.swift | ||
// | ||
// Copyright © 2024 Gini GmbH. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import GiniBankAPILibrary | ||
|
||
class AnalyticsMapper { | ||
|
||
static func documentTypeAnalytics(from noResultType: NoResultScreenViewController.NoResultType) -> String { | ||
switch noResultType { | ||
case .pdf: | ||
return "pdf" | ||
case .image: | ||
return "image" | ||
case .qrCode: | ||
return "qrCode" | ||
default: | ||
return "unknown" | ||
} | ||
} | ||
|
||
static func documentTypeAnalytics(from documentType: GiniCaptureDocumentType) -> String { | ||
switch documentType { | ||
case .pdf: | ||
return "pdf" | ||
case .image: | ||
return "image" | ||
case .qrcode: | ||
return "qrCode" | ||
} | ||
} | ||
|
||
static func errorAnalytics(from error: GiniError) -> ErrorAnalytics { | ||
switch error { | ||
case .badRequest(let response, _): | ||
return ErrorAnalytics(type: "bad_request", code: response?.statusCode, reason: error.message) | ||
case .notAcceptable(let response, _): | ||
return ErrorAnalytics(type: "not_acceptable", code: response?.statusCode, reason: error.message) | ||
case .notFound(let response, _): | ||
return ErrorAnalytics(type: "not_found", code: response?.statusCode, reason: error.message) | ||
case .noResponse: | ||
return ErrorAnalytics(type: "no_reponse", reason: error.message) | ||
case .parseError(_, let response, _): | ||
return ErrorAnalytics(type: "bad_request", code: response?.statusCode, reason: error.message) | ||
case .requestCancelled: | ||
return ErrorAnalytics(type: "request_cancelled", reason: error.message) | ||
case .tooManyRequests(let response, _): | ||
return ErrorAnalytics(type: "too_many_requests", code: response?.statusCode, reason: error.message) | ||
case .unauthorized(let response, _): | ||
return ErrorAnalytics(type: "unauthorized", code: response?.statusCode, reason: error.message) | ||
case .maintenance(let errorCode): | ||
return ErrorAnalytics(type: "maintenance", code: errorCode, reason: error.message) | ||
case .outage(let errorCode): | ||
return ErrorAnalytics(type: "outage", code: errorCode, reason: error.message) | ||
case .server(let errorCode): | ||
return ErrorAnalytics(type: "server", code: errorCode, reason: error.message) | ||
case .unknown(let response, _): | ||
return ErrorAnalytics(type: "unknown", code: response?.statusCode, reason: error.message) | ||
case .noInternetConnection: | ||
return ErrorAnalytics(type: "no_internet") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
CaptureSDK/GiniCaptureSDK/Sources/GiniCaptureSDK/Core/Tracking/ErrorAnalytics.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// ErrorAnalytics.swift | ||
// | ||
// Copyright © 2024 Gini GmbH. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct ErrorAnalytics { | ||
let type: String | ||
let code: Int? | ||
let reason: String? | ||
|
||
init(type: String, code: Int? = nil, reason: String? = nil) { | ||
self.type = type | ||
self.code = code | ||
self.reason = reason | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters