FrekisSDK 0.0.4

FrekisSDK 0.0.4

Maintained by Ivan Oliver, Yash.



 
Depends on:
NotificationBannerSwift~> 3.0.0
FMDB>= 0
 

FrekisSDK 0.0.4

  • By
  • Frekis Developers

Frekis SDK is iOS Framework which will help you to connect with the frekis account and manage your assets with in own app.

Installation

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Frekis into your Xcode project using CocoaPods, specify it in your Podfile:

  pod 'Frekis', '~> 5.2'

Include Frekis SDK dependency in to your Xcode project

    impore FrekisFramework

Usage

To initialize the sdk, Use below code and setListeners to receive the callback.

//  Managed this instance class as a singleton class for further usage.
//  Recommended usages is to keep this instance in application class.
Frekis instance = Frekis.getInstance(context)
//  Set session connection listener
instance.setSessionConnectionListener(this);
//  Set BleConnection Listener
instance.setBleConnectionListener(this);
//
instance.init(token /* Replace your token here, Contact support to generate your app token*/)

SessionConnectionListener will invoked when client is successfully connected with Frekis SDK or when there is some error.

public interface SessionConnectionListener {
   void onSessionConnectionSuccess();
   void onSessionConnectionError(int code, String error_message);
}

BleConnectionListener is for status update with ble devices, In Frekis they are know for asset.

public interface BleListener {
  void onBleStatusUpdate(String status);
  void onBleConnected();
  void onBleConnectionError(int code, String message);
}

Unlock and lock the asset - Make sure the frekis sdk is connected and asset is connected before calling this method. Note, Client has to manually detect the status of lock and call this method once user is manually locking the device.

frekis.unlockAsset(lock_id, location, listener);
frekis.lockAsset(lock_id, location, listener);