「IOS Beacon DeviceInfo SDK Tutorial」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser (→使用方式) |
imported>Wikiuser |
||
(未顯示同一使用者於中間所作的 6 次修訂) | |||
行 6: | 行 6: | ||
! Version !! Package !! Notes | ! Version !! Package !! Notes | ||
|- | |- | ||
|1.0.0 || | |1.0.0 ||[[媒體: TADBeaonInfoSDK.zip|BeaconInfoSDK.zip]] || | ||
|} | |} | ||
行 13: | 行 13: | ||
*Xcode 7或以上的版本 | *Xcode 7或以上的版本 | ||
2.將SDK加入iOS Project中,包含以下的檔案 | 2.將SDK加入iOS Project中,包含以下的檔案 | ||
* | *libTAMediaBeaconInfoSDK.a | ||
*TADBeaconManager.h | *TADBeaconManager.h | ||
拖移SDK進入專案,點選Copy items if needed以及在Add to targets處打勾 | 拖移SDK進入專案,點選Copy items if needed以及在Add to targets處打勾 | ||
[[檔案: BeaconInfo_Import_SDK_1.png|none|800px]] | [[檔案: BeaconInfo_Import_SDK_1.png|none|800px]] | ||
在info.plist中加入App Transport Security Settings,並在下方加入Allow Aribitrary Loads的Key, 並將該Value設成YES | |||
[[檔案:Beacon_project_setting_4.png|none|800px]] | |||
在Build Settings中,搜尋Other Linker Flags後,輸入-Objc[[檔案:Beacon_project_setting_7.png|800px]] | 在Build Settings中,搜尋Other Linker Flags後,輸入-Objc[[檔案:Beacon_project_setting_7.png|800px]] | ||
==使用方式== | ==使用方式== | ||
在要呼叫SDK的頁面import TADBeaconManager.h | |||
#import "TADBeaconManager.h" | |||
輸入由TAMedia提供的Token及欲查詢的Beacon UUID,major,minor,SDK會回傳一個NSDictionary裡面包含了此Beacon的設備資訊 | 輸入由TAMedia提供的Token及欲查詢的Beacon UUID,major,minor,SDK會回傳一個NSDictionary裡面包含了此Beacon的設備資訊 | ||
[[TADBeaconManager sharedBeaconManager] getBeaconInfoWithToken:@"aaaabbbbcccc124" | [[TADBeaconManager sharedBeaconManager] getBeaconInfoWithToken:@"aaaabbbbcccc124" /*TAMedia提供的Token*/ | ||
UUID:@"44f426dd-b436-46a5-9399-328366d78fbc" | UUID:@"44f426dd-b436-46a5-9399-328366d78fbc" /*欲查詢的BeaconUUID*/ | ||
major:@"1" | major:@"1" | ||
minor:@"1" | minor:@"1" | ||
行 30: | 行 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" | |||
} | |||
呈現範例 | |||
[[檔案:BeaconInfo_app_Sample_1.png|none|300px]] | |||
[[Beacon_Main_Page|回Beacon首頁]] |
於 2017年7月12日 (三) 07:21 的最新修訂
使用者可藉由此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" }
呈現範例