「IOS Beacon DeviceInfo SDK Tutorial」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser (→使用方式) |
imported>Wikiuser (→使用方式) |
||
行 36: | 行 36: | ||
}]; | }]; | ||
回傳的NSDictionary範例 | |||
{ | |||
"tax_id": 0, | |||
"mac_address": "C4:BE:84:21:D2:69", | |||
"uuid": "44F426DD-B436-46A5-9399-328366D78FBC", | |||
"major": 500, | |||
"minor": 503, | |||
"location": "25.0436094,121.5574128", | |||
"power": 0, | |||
"physical_address": "台北市光復南路100號", | |||
"register_date": "Jun 30, 2016 3:04:57 PM", | |||
"service_date": "Jun 30, 2016 12:00:00 AM" | |||
} | |||
呈現範例 | |||
[[Beacon_Main_Page|回Beacon首頁]] | [[Beacon_Main_Page|回Beacon首頁]] |
於 2017年7月12日 (三) 07:20 的修訂
使用者可藉由此SDK取得Beacon的設備資訊
Getting Started
SDK下載
Version | Package | Notes |
---|---|---|
1.0.0 | BeaconInfoSDK.zip |
1.系統需求
- iOS 8.0或以上的版本
- Xcode 7或以上的版本
2.將SDK加入iOS Project中,包含以下的檔案
- libTAMediaBeaconInfoSDK.a
- TADBeaconManager.h
拖移SDK進入專案,點選Copy items if needed以及在Add to targets處打勾
在info.plist中加入App Transport Security Settings,並在下方加入Allow Aribitrary Loads的Key, 並將該Value設成YES
在Build Settings中,搜尋Other Linker Flags後,輸入-Objc
使用方式
在要呼叫SDK的頁面import TADBeaconManager.h
#import "TADBeaconManager.h"
輸入由TAMedia提供的Token及欲查詢的Beacon UUID,major,minor,SDK會回傳一個NSDictionary裡面包含了此Beacon的設備資訊
[[TADBeaconManager sharedBeaconManager] getBeaconInfoWithToken:@"aaaabbbbcccc124" /*TAMedia提供的Token*/ UUID:@"44f426dd-b436-46a5-9399-328366d78fbc" /*欲查詢的BeaconUUID*/ major:@"1" minor:@"1" success:^(NSDictionary *beaconInfo) { //取得Beacon設備資訊成功 } fail:^(NSString *errorMessage) { }];
回傳的NSDictionary範例
{ "tax_id": 0, "mac_address": "C4:BE:84:21:D2:69", "uuid": "44F426DD-B436-46A5-9399-328366D78FBC", "major": 500, "minor": 503, "location": "25.0436094,121.5574128", "power": 0, "physical_address": "台北市光復南路100號", "register_date": "Jun 30, 2016 3:04:57 PM", "service_date": "Jun 30, 2016 12:00:00 AM" }
呈現範例