Manos Chorianopoulos

save steps on campaign back button press

......@@ -35,6 +35,28 @@ var timer2: DispatchSourceTimer?
}
stopTimer()
let persistedSteps = swiftApi().getSteps()
if (persistedSteps > 0) {
let currentDateTime = Date()
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
let dateString = dateFormatter.string(from: currentDateTime)
swiftApi().setPacingDetailsAsync(persistedSteps, dateString, setPacingDetailsAsyncCallback)
}
func setPacingDetailsAsyncCallback (_ responseData: swiftApi.GenericResponseModel?) -> Void {
if (responseData != nil) {
DispatchQueue.main.async {
if (responseData?.getStatus == 1) {
print("===== steps sent on back button press ====")
}
}
} else {
}
}
}
public override func viewDidLoad() {
......