Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

BLOCKvIO/ios-sdk

Repository files navigation

BLOCKv SDK for iOS

Version License Platform

This is the official BLOCKv SDK. It allows you to easily build your own Vatom Viewer app, or integrate your own apps into the BLOCKv platform.

Requirements

  • iOS 11.0+
  • Xcode 11.4+
  • Swift 5.2+

Installation

Swift Package Manager

Simply add the package dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/BLOCKvIO/ios-sdk", from: "4.0.0"),
]

and specify "BLOCKv" as a dependency in the appropriate targets.

Cocoapods

To install, simply add the following line to your .podfile:

pod 'BLOCKv', => '4.0.0'

Configuration

Within the AppDelegate be sure to set the App ID.

class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        // Set app id
        BLOCKv.configure(appID: "your-app-id")

        // Check logged in state
        if BLOCKv.isLoggedIn {
            // show interesting ui
        } else {
            // show authentication ui
        }

        // Handle user re-authentication
        BLOCKv.onLogout = {
            // show authentication ui
        }

        return true
    }
}

Sample App

The sample app lets you try out the BLOCKv SDK. It's a great place to start if you're getting up to speed on the platform. It offers the following features:

  • Authentication (registration & login)
  • Profile management
  • Fetching the user's inventory of Vatoms
  • Fetching individual Vatoms
  • Searching for Vatoms on the BLOCKv platform
  • Responding to Web socket events
  • Displaying Vatoms in a UICollectionView
  • Visually representing Vatoms using faces

To run the example project, clone the repo, and run pod install from the Example directory first.

Design

The SDK has two logical modules: Core and Face. The responsibilities are as follows:

Core

  • API integration
    • Provides platform endpoints with a strongly typed API.
  • User token management
    • Handles platform authentication.
  • Web socket integration
    • Simplified layer for interacting with the websocket.
  • Data Pool
    • Vends 'regions' which monitor a collection of Vatoms. Enables real-time synchronization for some regions.

Face

  • Face view infrastructure
  • Embedded face views e.g. ImageFaceView
  • Convenience classes to assist in displaying Vatoms e.g. VatomView

Versioning

This SDK adheres to semantic versioning.

Security Disclosure

If you believe you have identified a security vulnerability with BLOCKv, you should report it as soon as possible via email to support@blockv.io. Please do not post it to a public issue tracker.

Author

BLOCKv

License

BLOCKv is available under the BLOCKv AG license. See the LICENSE file for more info.