Plain C SDK for iOS

If you need low-level access to the full Nabto Edge Client SDK, you can use the general Plain C SDK built for iOS. It is distributed as an XCFramework bundle through the nabto-client-sdk-releases github repository.

For typical iOS apps, the high-level Swift based iOS Client SDK is highly recommended over the low-level, plain C based SDK. It is much simpler to use from both Swift and Objective C based apps.

INSTALLATION

Download the XCFramework bundle and make it available for your build process: Download zip file.

The downloaded XCFramework bundle must be added to your project, see below.

Configure Xcode project

To add the Nabto library to your Xcode project:

  1. unzip the downloaded bundle in your project directory, e.g. in the root dir

  2. select your target in the “Targets” list

  3. go to “General”

  4. go to the “Frameworks, Libraries, and Embedded Content” section

  5. click ‘+’ and then ‘Add Other…’

  6. locate the NabtoEdgeClientApi.xcframework bundle you extracted in step 1 and add it

USE THE SDK

From Objective C, you can import NabtoEdgeClientApi after adding the NabtoEdgeClientApi framework bundle and then use the raw plain C API functions:

@import NabtoEdgeClientApi;

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"Nabto SDK Version %s", nabto_client_version());
}

See the API docs for more details and the examples below.

EXAMPLES

A simple example that invokes a Nabto Edge CoAP service is available in github, edge-hello-objc-cocoapods.