Zebra-wechat
The SDK is currently in the development State and currently implements the following features:
Receive server push information to identify the type of push information
API Client Encapsulation (user management, user group management, customer service Management, custom menu management, System Management, etc.)
Jump Verify Encapsulation
Card Roll Support
Blog Address: www.huyanping.cn
Receive push samples
Use \jenner\zebra\wechat\wechatserver;use \jenner\zebra\wechat\response\textresponse, $token = ' you Wechat token '; $ Server = new Wechatserver ($token);//Call before processing event, whether or not there is a registered event handler $server->on (' Before ', function (Wechatserver $server, $ Request) {//do something}), or//after handling the event call, $result the return value of the event handler $server->on (' After ', function (Wechatserver $server, $ Result) {//do something});//Unknown Message Processor $server->on (' Unknown_message ', function (Wechatserver $server, $request) {//do something});//Unknown Time processor $server->on (' Unknown_event ', function (Wechatserver $server, $request) {//do something});// Handle text message Push $server->on (' text ', function (Wechatserver $server, $request) {$to _user = $server->getfromusername (); $from _user = $server->gettousername (); $response = new Textresponse ($to _user, $from _user, ' hello '); $server->send ($response);}); /Handling Focus Push $server->on (' subscribe ', function (Wechatserver $server, $request) {$to _user = $server->getfromusername ( ); $from _user = $server->gettouserName (); $response = new Textresponse ($to _user, $from _user, ' thx '); $server->send ($response);});
To send messages proactively
Define (' wechat_app_id ', ' Your APP ID ');d efine (' Wechat_secret ', ' your SECRET '); $to _user = ' to_user_open_id '; $text = ' Hello '; $text _message = new \jenner\zebra\wechat\client\message\textmessage ($to _user, $text); $text _message->send ();