5. 功能與物件說明 - iii-bolinli/Beacon-Content GitHub Wiki

本說明一共分為兩個部分:

  1. resultData 中的回傳資料
  2. 取得 BeaconContent
  3. beaconContentByBeaconID()
  4. 資料結構說明
  5. AppBeacon
  6. Push_message
  7. Result_content
  8. Coupons
  9. Products
  10. Links
  11. Texts

  1. 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
  1. 取得 BeaconContent

初始化完 BeaconContent 後

BeaconContent BC = new BeaconContent(server_ip);

取得推播資訊 (Push_message)

  1. beaconContentByBeaconID()
beaconContentByBeaconID(String beacon_id, String app_key)
  1. 資料結構

  2. 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;
  1. Push_message
String resource;
String method;
String result;
String error_msg;
Result_content result_content;
  1. Result_content
String contentType;
List<Coupons> coupons;
List<Products> products;
  1. 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;
  1. 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;
  1. Links
private String templateName;
private String templateDescription;
private String name;
private String description;
private String url;
  1. Texts
private String templateName;
private String templateDescription;
private String name;
private String textcontent;
⚠️ **GitHub.com Fallback** ⚠️