zaloplatform / zalo-php-sdk

MIT License
63 stars 41 forks source link

GraphRawResponse.php on line 91 Khi lấy thông tin người dùng #14

Open thanhansoft opened 4 years ago

thanhansoft commented 4 years ago

Hi Zalo develop,

Mình đang dùng thử zalo php truy xuất OK nhưng ra báo chú ý thế này: Notice: Undefined offset: 1 in D:\Fdola\zalo-php-sdk\vendor\zaloplatform\zalo-php-sdk\src\Http\GraphRawResponse.php on line 91

<?php require_once DIR . '/vendor/autoload.php';

use Zalo\Zalo; use Zalo\ZaloEndPoint;

$config = array( 'app_id' => '2022730018168863445', 'app_secret' => 'OPIQFJrYNU7K4hXwYjNY', 'callback_url' => 'http://localhost/callback.php' ); $zalo = new Zalo($config);

//Lấy thông tin người dùng $accessToken = 'IH5mOWmU-rrB4tPf3HZoNKmMUcKE1Pyp255NQHDTkL8FLp4g413dO19R5mPT3UT97LCiTWmA-3CZ6ZLl6X3B4XbbHL0n3PeOB6beSsCLvZjuQoz_HoBzGM1gC7LHFxvDKd53TNyhbZn3H7zSNHJmF71eE7jB7-v7TqGhBMG8r59xLbfeT2o2DarZQtW3DxOE04XOBm41fd4_NKL932EU3HfEGMay6RbH879F1HeAabeCNM0k3LNjPo0wDo8VTE5W1YLm52GezNC7NpquEX7pK5HjTpsy30q2_bu'; $params = ['fields' => 'id,name,birthday,gender,picture']; $response = $zalo->get(ZaloEndpoint::API_GRAPH_ME, $accessToken, $params); $result = $response->getDecodedBody(); // result

print_r($result);

yendangatg commented 4 years ago

Mình cũng bị lỗi tương tự, nhưng PR https://github.com/zaloplatform/zalo-php-sdk/pull/10 vẫn chưa được merge