Fixes #614 - Add the user and device identifiers to rageshakes (#620)

* Fixes #614 - Add the user and device identifiers to rageshakes

* Add `base_bundle_identifier` to rageshakes
This commit is contained in:
Stefan Ceriu
2023-02-24 14:51:36 +02:00
committed by GitHub
parent 252a5f2bdc
commit a3abde9e23
15 changed files with 79 additions and 23 deletions
@@ -19,14 +19,21 @@ import SwiftUI
typealias BugReportViewModelType = StateStoreViewModel<BugReportViewState, BugReportViewAction>
class BugReportViewModel: BugReportViewModelType, BugReportViewModelProtocol {
let bugReportService: BugReportServiceProtocol
private let bugReportService: BugReportServiceProtocol
private let userID: String
private let deviceID: String?
var callback: ((BugReportViewModelAction) -> Void)?
init(bugReportService: BugReportServiceProtocol,
userID: String,
deviceID: String?,
screenshot: UIImage?,
isModallyPresented: Bool) {
self.bugReportService = bugReportService
self.userID = userID
self.deviceID = deviceID
let bindings = BugReportViewStateBindings(reportText: "", sendingLogsEnabled: true)
super.init(initialViewState: BugReportViewState(screenshot: screenshot,
bindings: bindings,
@@ -61,7 +68,9 @@ class BugReportViewModel: BugReportViewModelType, BugReportViewModelProtocol {
try pngData?.write(to: imageURL)
files.append(imageURL)
}
let bugReport = BugReport(text: context.reportText,
let bugReport = BugReport(userID: userID,
deviceID: deviceID,
text: context.reportText,
includeLogs: context.sendingLogsEnabled,
includeCrashLog: true,
githubLabels: [],