The SDK can be found here: https://github.com/nuubit/SDK
Self Service Signup: https://portal.nuubit.net/#/signup/plans
The following is a step by step guild to using the nuu:bit SDK in a Swift environment.
Step 1 - Place the RevSDK.framework into the project folder.
Step 2 - In Xcode, go to "Linked Frameworks and Libraries" in your project settings (tab General). Click the Add (+) button. Click "Add other" button and select RevSDK.framework that you copied to your project folder.
Step 3 - Go to "Embedded Binaries" in the same project settings tab. Click the Add (+) button. In the window that appears, select "RevSDK.framework" then click "Add".
Step 4 - Open the "info.plist" file. Add the following root element:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Step 5 - Adding a Swift Bridging Header
In order to use the Object-C library in a swift environment, there needs to be a bridge header. If the project is already being used Bridging Header simply go to the next step.
Create a new header file in your project.
Step 6 - Click the "Build settings", section Swift Compiler - Code Generation. In the "Objective-C Bridging Header", specify the header file you created.
Step 7 - To create the bridging.h or adding #import <RevSDK/RevSDK.h> to the bridge header.
//
// Example Briding Header File for use with nuu:bit //
#ifndef Example_Example_ObjCBridgeing_h
#define Example_Example_ObjCBridgeing_h
#import <RevSDK/RevSDK.h>
#endif
Step 8 - To initialize the nuu:bit SDK add the following line to the AppDelegate.swift. Add in the didFinishLaunchingWithOptions function add the following line:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is the nuu:bit SDK key which is generated from the portal.RevSDK.startWithSDKKey("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
As an example:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
RevSDK.startWithSDKKey("f0a3ffff-e231-9999-bbbb-6b9cf5ff8fff");
return true
}
Step 9 - Build project and control the nuu:bit from the portal.
0 Comments