iOS SampleProject for the thing-if SDK
- iOS 9.0+
- Xcode 7.0+
- swift 2.0+
- KiiSDK.framework
- ThingIFSDK.framework
This is the easiest way to get started. SampleProject uses CocoaPods to manage dependency.
If CocoaPods is not installed, please install it first by following the installation Guide.
The ./Podfile
is used to define latest version of KiiSDK and ThingIFSDK to be imported. Just run the following command:
$ pod install
SampleProject is also can be used with Carthage. But since KiiSDK is not available on Carthage, You should mix it with CocoaPods. The benefit of using Carthage is the flexibility to choose ThingIFSDK branch (CocoaPods only support for master branch).
Remove 'ThingIFSDK' from The ./Podfile
.
The ./Podfile
is used to define latest version of KiiSDK to be imported. Just run the following command:
$ pod install
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
-
Install Carthage with Homebrew using the following command:
$ brew update $ brew install carthage
-
Specify thing-if SDK it in your
Cartfile
:github "KiiPlatform/thing-if-iOSSDK" >= 0.8
-
Then generate thing-if SDK framework by the following command:
$ carthage update
-
After successfully generated thing-if SDK framework, import it to SampleProject.
After above steps finished, open ./SampleProject.xcworkspace
Both of KiiSDK and thing-if SDK need the same appID and appKey. Please set the appropriate values in the file ThingIFSDK/Properties.plist
.
-
Initialize KiiSDK in
ThingIFSDK/AppDelegate.swift
- If using one of US, JP, CN and SG, please call
Kii.beginWithID((dict["appID"] as! String), andKey: (dict["appKey"] as! String), andSite: KiiSite)
using appropriate value for the site. - If using a custom base URL, please provide a value of
kiiCloudCustomURL
for KiiSDK inThingIFSDK/Properties.plist
. Then callKii.beginWithID((dict["appID"] as! String), andKey: (dict["appKey"] as! String), andCustomURL: (dict["kiiCloudCustomURL"] as! String))
- If using one of US, JP, CN and SG, please call
-
Initialize thing-if SDK in
ThingIFSDK/LoginViewController.swift
when callingIoTCloudAPIBuilder(appID: (dict["appID"] as! String), appKey: (dict["appKey"] as! String), site: Site, owner: Owner, tag: String? )
- If using one of US, JP, CN and SG, please use
Site.US
,Site.JP
,Site.CN
, orSite.SG
for the value of site. - If using custom site base URL, please provide a value of
iotCloudAPIBaseURL
for thing-if SDK inThingIFSDK/Properties.plist
, then set the value of site withSite.CUSTOM((dict["iotCloudAPIBaseURL"] as! String))
.
- If using one of US, JP, CN and SG, please use
thing-if iOSSample is released under the MIT license. See LICENSE for details.