Class: Wechat::ShakeAround::BeaconPoiRelation
- Inherits:
-
Object
- Object
- Wechat::ShakeAround::BeaconPoiRelation
- Extended by:
- Core::Common, Common
- Defined in:
- lib/wechat/shake_around/beacon_poi_relation.rb
Overview
Beacon Poi Relation 是管理 iBeacon 设备和入口 (PoI, Point of Interest) 之间关系的封装类。
Constant Summary
Constants included from Common
Class Method Summary collapse
Methods included from Common
normalize_date, normalize_device_id, normalize_page_ids
Class Method Details
.create(access_token, device_id, poi_id) ⇒ Object
Return hash format if success:
data: {,
errcode: 0,
errmsg: 'success.'
}
device_id is an integer or a hash like { uuid: <UUID>, major: <MAJOR>, minor: <MINOR> }.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/wechat/shake_around/beacon_poi_relation.rb', line 21 def self.create(access_token, device_id, poi_id) assert_present! :access_token, access_token assert_present! :device_id, device_id assert_present! :poi_id, poi_id device_identifier = self.normalize_device_id device_id post_json "https://api.weixin.qq.com/shakearound/device/bindlocation?access_token=#{access_token}", body: { device_identifier: device_identifier, poi_id: poi_id.to_i } end |