This package contains the gomobile
-compatible version of the SDK. It acts as a wrapper for the Go SDK.
- Go 1.23 or newer
- The gomobile tools:
go install golang.org/x/mobile/cmd/gomobile@latest gomobile init
$GOPATH/bin
added to your path
- Android SDK (installable via the SDK Manager in Android Studio)
- Android NDK (installable via the SDK Manager in Android Studio)
- JDK
- A Mac
- Xcode Command Line Tools - these are included with Xcode, but can also be installed standalone with
xcode-select --install
- Agreed to the Xcode licence agreement prompt via Terminal. Creating the iOS bindings will trigger the prompt if you haven't agreed to the licence yet
To generate both the Android and iOS bindings in one command:
make generate-all-bindings
To generate only the Android bindings:
make generate-android-bindings
To generate only the iOS bindings:
make generate-ios-bindings
The generated bindings can be found in the bindings
folder.
For usage documentation + examples, see here.
- After importing
walletsdk.aar
into your Android project, to use the Wallet SDK packages in a Kotlin or Java file, you import them in a roughly similar way as you would the equivalent Go package:// Follow the pattern below for other packages/types as well import dev.trustbloc.wallet.sdk.api.*; import dev.trustbloc.wallet.sdk.openid4ci.*;
- After importing the iOS bindings into Xcode, to use the Wallet SDK in a Swift file, add the following:
To use the Wallet SDK in an Objective-C file, do the following:
// This imports everything import Walletsdk
Alternatively, you can import individual files. For example:#import <Walletsdk/Walletsdk.h>
Note that the various types, interfaces and methods will have the package names prefixed to them (e.g.#import <Walletsdk/Api.objc.h> #import <Walletsdk/Storage.objc.h>
Signer
in Go becomesCredentialsignerSigner
in Swift and Objective-C). - If you've regenerated bindings on your machine, make sure you update your Android Studio or Xcode project accordingly.