5. 功能與物件說明 - iii-bolinli/Beacon-Content GitHub Wiki
本說明一共分為兩個部分:
- resultData 中的回傳資料
- 取得 BeaconContent
- beaconContentByBeaconID()
- 資料結構說明
- AppBeacon
- Push_message
- Result_content
- Coupons
- Products
- Links
- Texts
- BroadcastReceiver 中 onReceive 的 intent 回傳資料
// 回傳資訊
Bundle resultData = intent.getExtras();
取得方式 | 內容 |
---|---|
resultData.getString("ScanState") | Scanning Beacon. |
resultData.getString("ScanState") | Stop Scanning Beacon. |
resultData.getString("Msg") | Device does not support Bluetooth. |
resultData.getString("Msg") | Bluetooth is not enable. |
resultData.getString("Msg") | get beacon list http request error. |
resultData.getString("Msg") | beacon detect log update http request error. |
resultData.getInt("id") | Beacon ID 用來查詢推播資訊 |
resultData.getInt("uuid") | Beacon uuid (Major-Minor) |
resultData.getDouble("distance") | Beacon 距離 (公尺) |
resultData.getInt("rssi") | RSSI |
resultData.getInt("tx_power") | tx_power |
- 取得 BeaconContent
初始化完 BeaconContent 後
BeaconContent BC = new BeaconContent(server_ip);
取得推播資訊 (Push_message)
- beaconContentByBeaconID()
beaconContentByBeaconID(String beacon_id, String app_key)
-
資料結構
-
AppBeacon
String beacon_id; // ID
Number major;
Number minor;
String beacon_uuid; // Major-Minor;
String beacon_proximity_uuid;
String name;
String address;
Number latitude;
Number longitude;
String description;
Number status;
Number power;
- Push_message
String resource;
String method;
String result;
String error_msg;
Result_content result_content;
- Result_content
String contentType;
List<Coupons> coupons;
List<Products> products;
- Coupons
String templateName
String templateDescription
String sellerName;
String sellerDescription;
String couponBriefDescription;
String couponDetailDescription;
String others;
Number quantity;
Number surplus;
String photoUrl;
String validStartDate;
String validEndDate;
- Products
String templateName
String templateDescription
String sellerName;
String sellerDescription;
String productBriefDescription;
String productDetailDescription;
String others;
Number originPrice;
String discount;
Number quantity;
Number surplus;
String photoUrl;
String validStartDate;
String validEndDate;
- Links
private String templateName;
private String templateDescription;
private String name;
private String description;
private String url;
- Texts
private String templateName;
private String templateDescription;
private String name;
private String textcontent;