The XYO Foundation provides this source code available in our efforts to advance the understanding of the XYO Protocol and its possible uses. We continue to maintain this software in the interest of developer education. Usage of this source code is not intended for production.
Demo iOS App for using the XYO Protocol 2.0 from Swift. Designed to work in both Mac OS and iOS.
dependencies: [
.package(url: "https://github.com/XYOracleNetwork/app-ios-witness-demo-swiftui.git", .upToNextMajor(from: "3.0.0")),
],
Setup which network you'd like to write to by configuring the Domain & Archivist Module Name
let apiDomain = "https://beta.api.archivist.xyo.network"
let archive = "Archivist"
Configure your desired witnesses (Basic, System Info, Location, etc.)
let basicWitness = BasicWitness {
Payload("network.xyo.basic")
}
let systemInfoWitness = SystemInfoWitness(allowPathMonitor: true)
let locationWitness = LocationWitness()
Use the Witnesses & Archivist config to create a Panel
let panel = XyoPanel(
account: self.panelAccount,
witnesses: [
basicWitness,
systemInfoWitness,
locationWitness
],
apiDomain: apiDomain,
apiModule: apiModule
)
Call .report()
to return the witnessed Payloads
let payloads = await panel.report()
or, for more detailed information, call .reportQuery()
to return a ModuleQuery
result containing the BoundWitness
, Payloads
, & any Errors
(if present)
let result = await panel.reportQuery()
let bw = result.bw
let payloads = result.payloads
let errors = result.errors
See the LICENSE file for license details
Made with 🔥 and ❄️ by XYO