OmiseGO iOS SDK
The OmiseGO iOS SDK allows developers to easily interact with the OmiseGO eWallet. This SDK is split into 3 Cocoapods subspecs: Core, Client and Admin. The Core is a common dependency that contains the shared logic. The Client and Admin modules contain specific logic to respectively access the client or admin API.
Table of Contents
Requirements
- iOS 10.0+
- Xcode 10.2+
- Swift 5.0
This version of the SDK is compatible with the version 1.2.0 of the eWallet.
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
gem install cocoapodsIf you are using Cocoapods to integrate the SDK, you can take advantage of the subspecs that allows the integration of specific parts of the SDK separately.
If you only need to integrate and support the Client API then you can add only the Client subscpec by adding the following line in your Podfile:
pod 'OmiseGO/Client'Or if you only want to support the Admin API, you can use:
pod 'OmiseGO/Admin'Or if you need both simply use:
pod 'OmiseGO'Alternatively you can also specify a version ([read more about the Podfile] (https://guides.cocoapods.org/using/the-podfile.html)):
pod 'OmiseGO', '~> 1.2'Then, run the following command:
$ pod installCarthage
Carthage is a simple, decentralized dependency manager for Cocoa.
brew install carthageTo integrate the omisego SDK into your Xcode project using Carthage, add the following line in your Cartfile:
github "omisego/ios-sdk"
Then, run the following command:
carthage update --platform iosDrag the built OmiseGO.framework into your Xcode project.
Usage
Tests
In order to run the live tests (bound to a working server) you need to fill the corresponding variables in the plist file secret.plist.
Note: Alternatively, these keys can be provided with environment variables, making it easier and safer for CI to run since you don't need to keep them in the source code.
The variables are:
OMG_BASE_URLOMG_WEBSOCKET_URLOMG_API_KEYOMG_AUTHENTICATION_TOKENOMG_TOKEN_ID
You can then for example run the tests with the following command:
xcodebuild -workspace "OmiseGO.xcworkspace" -scheme "OmiseGO" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X' OMG_BASE_URL="https://your.base.server.url" OMG_API_KEY="yourAPIKey" OMG_AUTHENTICATION_TOKEN="yourTestAuthenticationToken" OMG_TOKEN_ID="aTokenId" OMG_WEBSOCKET_URL="wss://your.base.socket.url" test
Dependencies
There are two dependencies required to run the SDK.
- Starscream to manage websockets
- BigInt to manage big numbers
Contributing
See how you can help.
License
The OmiseGO iOS SDK is released under the Apache License.