FWQ
微信小程序消息推送php服务器验证
设置页面(“设置”>>“开发设置”): 设置服务器域名比如:https://hosts.com注意http和https协议的不同。 设置消息推送2.1 在你的服务器里添加服务器test.php,test.php接口内容主要是通过token验证消息是否为微信发来的,代码参照官方的例子:define(“TOKEN”,”xxxxx”);/ 后台填写的token$wechatObj = wechatAPI();$wechatObj->isValid(); wechatAPI{public function isValid()//验证微信接口,如果确认是微信就返回它传来的str参数{ $echoStr = $_GET[“echostr”]; ($this->checkSignature()) { echo $echoStr; exit; }}private function checkSignature() //官方的验证{ $signature = $_GET[“signature”];…