J1STSDK 0.1.9 × License MIT Released Last Release Oct 2016 Maintained by Jarry . Installation Guide × Installation Guide for J1STSDK You want to add pod 'J1STSDK', '~> 0.1' similar to the following to your Podfile: target 'MyApp' do pod 'J1STSDK', '~> 0.1' end Then run a pod install inside your terminal, or from CocoaPods.app. Alternatively to give it a test run, run the command: pod try J1STSDK See Podspec GitHub Repo Page on CocoaPods.org J1STSDK 0.1.9 By Jarry zenin-tech/J1ST-SDK-iOS GitHub Repo J1ST.IO iOS SDK J1ST.IO 及时云平台应用,针对iOS设备,帮助开发者搭建奇思妙想的 IoT 产品。 SDK 快速入门 注册开发者账号 [待补充] [待补充] 添加使用代码 添加头文件 #import <J1STSDK/J1STSDK.h> 初始化SDK 从 Dev Console 获取当前 Product 的 Key ; 在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 中添加初始化代码,使用 Dev Console 获取到的 Key 替换代码中的 Key : [J1STSDK startServiceWithProductKey:key resultBlock:^(NSString *result, NSError *error) { if (result) { NSLog(@"Start success with Agent ID : %@", result); else { NSLog(@"Start failed with error : %@", error.description); 定义上行数据内容(J1STUpstreamData),调用上发数据API接口: J1STUpstreamData *data = [J1STUpstreamData new]; data.deviceType = AGENT; data.data = [NSDictionary dictionaryWithObjectsAndKeys:@"ZE16A", @"Model", @"1.0.0", @"FwVer", nil]; [J1STSDK sendUpstreamData:data resultBlock:^(BOOL success, NSError *error) { if (success) { NSLog(@"Send Upstream Data Success"); else { NSLog(@"Send Upstream Data failed with error : %@", error.description); 在默认消息中心添加的监听代码 : [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMessageReceived:) name:kJ1STDidReceivedMessageNotification object:nil]; 添加消息处理代码 : - (void)onMessageReceived:(NSNotification *)notification { J1STUpstreamData *data = [notification object]; // 添加消息处理代码