Sha256: e67dce7814b31747c80d71956f02c43e9720e8b280d4dcb02aa1ced0b1260226

Contents?: true

Size: 951 Bytes

Versions: 3

Compression:

Stored size: 951 Bytes

Contents

##
# 微信摇一摇周边的摇动封装类。

class Wechat::ShakeAround::Shaking

  extend Wechat::Core::Common
  extend Wechat::ShakeAround::Common

  ##
  # 获取摇周边的设备及用户信息
  # http://mp.weixin.qq.com/wiki/3/34904a5db3d0ec7bb5306335b8da1faf.html
  #
  # Return hash format if success:
  # {
  #   data:
  #   {
  #     page_id: <PAGE_ID>,
  #     openid:  <OPEN_ID>,
  #     poi_id:  <POI_ID>,
  #     beacon_info:
  #     {
  #       distance: <DISTANCE>,
  #       uuid:     <UUID>,
  #       major:    <MAJOR>,
  #       minor:    <MINOR>
  #     }
  #   },
  #   errcode: 0,
  #   errmsg:  'success.'
  # }
  def self.load(access_token, ticket)

    assert_present! :access_token, access_token
    assert_present! :ticket,       ticket

    post_json "https://api.weixin.qq.com/shakearound/user/getshakeinfo?access_token=#{access_token}", body:
      {
        ticket:   ticket,
        need_poi: 1
      }
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wechat-shake_around-1.1 lib/wechat/shake_around/shaking.rb
wechat-shake_around-1.0 lib/wechat/shake_around/shaking.rb
wechat-shake_around-0.9.2 lib/wechat/shake_around/shaking.rb