首页 > 微信 > 详细

Delphi XE7 用indy开发微信公众平台(4)- 接收事件推送

时间:2015-02-09 22:58:50      阅读:442      评论:0      收藏:0      [点我收藏+]

接收事件推送

type
  TEventType = (subscribe, unsubscribe, SCAN, LOCATION, CLICK, VIEW);

function ResponseEvent(M: TMessage; X: IXMLDocument): RawByteString;
var
  event: TEventType;
  temp, menu: String;
begin
  temp := X.DocumentElement.ChildNodes.Nodes[Event].NodeValue;
  event := TEventType(GetEnumValue(TypeInfo(TEventType), temp));
  with X.DocumentElement.ChildNodes do
    case event of
      subscribe:
        begin
          Result := ‘‘;
          addlog(事件: + temp + ,  + M.FromUserName);
        end;
      unsubscribe:
        begin
          Result := ‘‘;
          addlog(事件: + temp + ,  + M.FromUserName);
        end;
      SCAN:
        begin
          Result := ‘‘;
          addlog(事件: + temp + ,  + M.FromUserName);
        end;
      LOCATION:
        begin
          Result := ‘‘;
         addlog(事件: + temp + ,  + M.FromUserName);
        end;
      CLICK:
        begin
          menu := Nodes[EventKey].NodeValue;
          addlog(事件: + temp + ,  + menu + ,  + M.FromUserName);
        end;
      VIEW:
        begin
          menu := Nodes[EventKey].NodeValue;
          Result := ‘‘;
          addlog(事件: + temp + ,  + menu + ,  + M.FromUserName);
        end
    else
      begin
        addlog(事件: + temp + ,   + M.FromUserName);
      end;
    end;
end;

 

原文地址:http://www.cnblogs.com/devinlee/p/4282638.html

Delphi XE7 用indy开发微信公众平台(4)- 接收事件推送

原文:http://www.cnblogs.com/devinlee/p/4282638.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!