Konrad Leszczyński edited this page Oct 4, 2018 · 19 revisions

The library tries to be as similar as possible to the java/android version of the SymbIoTeSecurity The class SecurityHandler has the same methods with the same names of parameters

Purpose

The library allows easy access to SymbIoTe API from iOS apps.

Requirements

Swift

swift version >= 3.2

ios deployment target >= 10.0

Tools

CocoaPods Manager

XCode

Installation

SymbIoTeSecurity4iOS is available through CocoaPods. To install it, simply add the following line to Podfile in your workspace:

pod 'SymbioteIosUtils'

and run pod install command

Other option is to clone/download this repository.

Note: CocoaPod Manager will automatically install SymbioteIosUtils library.

How to use

Knowing SymbIoTe API anyone can build a software (in any programming language) to join the ecosystem. However, it is not always easy to remember all the url paths, http headers format and security procedures. To simplify iOS apps development this library was created.
The library takes care of building http headers, acquiring request tokens, parsing JSONs from API, etc. so your app can be coded cleanly. To demonstrate the usage - this repository contains an Example app, that show how to call library method.

Search resources in the Core

Getting observations results - getting messured values from a device

Actuators - sending commands to devices

Functionalities

This library is derived from SymbIoTeSecurity java library and SymbIoTeSecurity for Android and tries to mimics their functionality as similar as possible.

The structure and syntax of Swift is completely different than java syntax, nevertheless we put a lot of effort to keep the usage coherent over all platforms. Therefore all the public functions in SecurityHandler have the same name (and names of the parameters are the same) and behavior is as similar as possible as in java/android version of the security library.

Therefore one can check SymbIoTeSecurity java library documentation for deeper understanding of security protocols used in the SymbIoTe project Also, please forgive us if you are a hardcore swift developer and hate java-like code structures and conventions - this is for the integrity sake :-)

Workspace structure

The workspace is made of the pod library itself and Example project. The library has typical folders structure for a CocoaPod lib (all classes in the Classes sub-folder) The Example project contains a simple app that is using the library and unit tests.

Structure

SecurityHandler class

This is the main class to refer when accessing SymbIoTe API.

public functions overview

init

getCoreAAMInstance

getAvailableAams

getCertificate

loginAsGuest

Another usage examples

The fully working application can be found SymbioteApp which is an app that combines L1 and L3/L4 resources

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.