jpush / jpush-api-php-client

JPush's officially supported PHP client library for accessing JPush APIs. 极光推送官方支持的 PHP 版本服务器端 SDK。
https://docs.jiguang.cn
MIT License
523 stars 174 forks source link

PHP7.2兼容问题 #64

Closed oyo775881 closed 6 years ago

oyo775881 commented 6 years ago

环境:

PHP7.2+ThinkPHP5.0.14

代码: $jpush = \think\Config::get('jpush'); $client = new \JPush\Client($jpush['app_key'], $jpush['app_secret']); $client->push()->setPlatform('all')->addAllAudience()->setNotificationAlert(‘123456’)->send();

报错: count(): Parameter must be an array or an object that implements Countable

ghost commented 6 years ago

请提供 server sdk 的版本与报错的具体到 server sdk 中的哪一行

另外单看报错信息的,如果真有这个问题的话,那也应该是所有的 php 版本都会产生的错误

oyo775881 commented 6 years ago

SDK是用的最新的,直接Composer安装的,报错到第几行也不太清楚了,代码跟踪过去显示是count这个函数的问题,因为已经换了信鸽推送,这边不能给您提供截图了。