mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Add Service Status page with service_health_check and report_issue examples
This commit is contained in:
27
snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift
Normal file
27
snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// ServiceStatus.swift
|
||||
//
|
||||
//
|
||||
// Created by dangeross on 27/11/2023.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import BreezSDK
|
||||
|
||||
func getServiceStatus(sdk: BlockingBreezServices) -> ServiceHealthCheckResponse? {
|
||||
// ANCHOR: health-check-status
|
||||
let healthCheck = try? sdk.serviceHealthCheck()
|
||||
print("Current service status is: \(healthCheck?.status)")
|
||||
// ANCHOR_END: health-check-status
|
||||
return healthCheck
|
||||
}
|
||||
|
||||
func reportPaymentFailure(sdk: BlockingBreezServices) {
|
||||
// ANCHOR: report-payment-failure
|
||||
let paymentHash = "..."
|
||||
|
||||
try? sdk.reportIssue(
|
||||
req: ReportIssueRequest.paymentFailure(
|
||||
data: ReportPaymentFailureDetails(paymentHash: paymentHash)))
|
||||
// ANCHOR_END: report-payment-failure
|
||||
}
|
||||
Reference in New Issue
Block a user