iOS

Requirements

Getting started

Installation

Add the AkilesSDK framework to your iOS project. If you are using CocoaPods, you can add this to your Podfile:

  pod 'AkilesSDK', :git => 'https://github.com/akiles/akiles-ios.git', :branch => 'v2.0.0'

Then, import the AkilesSDK framework:

import AkilesSDK

For Objective-C projects:

#import <AkilesSDK/AkilesSDK.h>

Basic Usage

  1. Initialize the SDK:

    let akiles = Akiles()
    
  2. Add a session using a token from the Akiles API:

    let sessionId = try await akiles.addSession(token: "your-session-token")
    
  3. Discover available gadgets:

    let gadgets = try await akiles.getGadgets(sessionID: sessionId)
    
  4. Perform an action on a gadget:

    let options = ActionOptions()
    options.useBluetooth = true
    options.useInternet = true
    
    let callback = MyActionCallback()
    
    await akiles.action(
        sessionID: sessionId,
        gadgetID: gadgets[0].id,
        actionID: gadgets[0].actions[0].id,
        options: options,
        callback: callback
    )
    

Card emulation

Card emulation on iOS uses the Host-based Card Emulation API. The upside is it’s free to use, but it comes with a set of restrictions imposed by Apple (it works in the European Economic Area only, it requires the user to open your app to use it).

We might add support for Apple Wallet in the future. This will allow it to work world-wide, at the cost of paying a per-credential-per-year fee to Apple. Please let us know if this is something you’re interested in.

Setup

Warning

Each AID you create makes NFC reading slightly slower. Do not create unnecessary AIDs. You can use the same AID for Android and iOS, do not create both. The only case where you really need multiple AIDs is when you have multiple Android apps and expect users to have them installed at the same time.

Usage

  1. Initialize the SDK:

    let akiles = Akiles()
    
  2. Add a session using a token from the Akiles API:

    let sessionId = try await akiles.addSession(token: "your-session-token")
    
  3. Start the card emulation:

    try await akiles.startCardEmulation(language: "en")
    

Submit your app for review

We’ve found the App Store review can be slow/finicky when you use the HCE entitlement. Here’s some tips to deal with it:

Demo app

Demo app screenshot

The repo contains an SDK demo app that showcases all major SDK features:

The app displays real-time status updates for both internet and Bluetooth operations, making it easy to test different scenarios.