Connect Wallets with dApps on Tezos
Beacon is an implementation of the wallet interaction standard tzip-10 which describes the connection of a dApp with a wallet.
The Beacon iOS SDK provides iOS developers with tools useful for setting up communication between native wallets supporting Tezos and dApps that implement beacon-sdk.
To add Beacon iOS SDK into your project, add the Beacon iOS SDK package dependency:
Open the Add Package Dependency window (as described in the official guide) and enter the Beacon iOS SDK GitHub repository URL:
https://github.com/airgap-it/beacon-ios-sdk
Add the following dependency in your Package.swift file:
.package(url: "https://github.com/airgap-it/beacon-ios-sdk", from: "1.0.0")The project is divided into the following targets:
BeaconSDK- the main library targetBeaconSDKDemo- an example application
The snippets below show how to quickly setup listening for incoming Beacon messages.
For more examples please see our demo app (WIP).
import BeaconSDK
class BeaconController {
private var client: Beacon.Client?
...
func startBeacon() {
Beacon.Client.create(with: Beacon.Client.Configuration(name: "My App")) { result in
switch result {
case let .success(client):
self.client = client
self.listenForBeaconMessages()
case let .failure(error):
/* handle error */
}
}
}
func listenForBeaconMessages() {
client?.connect { result in
switch result {
case .success(_):
self.client?.listen { request in
/* process messages */
}
case let .failure(error):
/* handle error */
}
}
}
}Beacon SDK - an SDK for web developers (dApp & wallet)
Beacon Android SDK - an SDK for Android developers (wallet)