All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.weixinmp.inbound.user.InboundLocationMessage Maven / Gradle / Ivy

The newest version!
package net.sf.weixinmp.inbound.user;

import net.sf.weixinmp.inbound.InboundMessage;
/**
 * https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140841&token=&lang=zh_CN
 * 地理位置消息,授权后微信主动获得 
开通了上报地理位置接口的公众号,用户在关注后进入公众号会话时,
开通了上报地理位置接口的公众号,用户在关注后进入公众号会话时,会弹框让用户确认是否允许公众号使用其地理位置。弹框只在关注后出现一次,用户以后可以在公众号详情页面进行操作。
第三方在收到地理位置上报信息之后,只需要回复success表明收到即可,是不允许回复消息给粉丝的。
获取用户地理位置
用户同意上报地理位置后,每次进入公众号会话时,都会在进入时上报地理位置,上报地理位置以推送XML数据包到开发者填写的URL来实现。



123456789


23.137466
113.352425
119.385040

参数说明:
参数	说明
ToUserName	开发者微信号
FromUserName	发送方帐号(一个OpenID)
CreateTime	消息创建时间 (整型)
MsgType	消息类型,event
Event	事件类型,LOCATION
Latitude	地理位置纬度
Longitude	地理位置经度
Precision	地理位置精度
 * @author Alex
 *
 */
public class InboundLocationMessage extends InboundMessage{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private float latitude;
	private float longitude;
	private float precision;
	private String event;
	public float getLatitude() {
		return latitude;
	}
	public void setLatitude(float latitude) {
		this.latitude = latitude;
	}
	public float getLongitude() {
		return longitude;
	}
	public void setLongitude(float longitude) {
		this.longitude = longitude;
	}
	public float getPrecision() {
		return precision;
	}
	public void setPrecision(float precision) {
		this.precision = precision;
	}
	public String getEvent() {
		return event;
	}
	public void setEvent(String event) {
		this.event = event;
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy