php-apple-signin icon indicating copy to clipboard operation
php-apple-signin copied to clipboard

Type error: Return value of AppleSignIn\ASDecoder::decodeIdentityToken() must be an instance of AppleSignIn\object, instance of stdClass returned

Open huaidan9527 opened this issue 5 years ago • 5 comments

Type error: Return value of AppleSignIn\ASDecoder::decodeIdentityToken() must be an instance of AppleSignIn\object, instance of stdClass returned

huaidan9527 avatar Apr 08 '20 03:04 huaidan9527

Same. Happens in php version 7.1 for me.

mcchrish avatar Apr 08 '20 07:04 mcchrish

Code cannot be less than php7.2 You can consider upgrading your PHP version

yanlong-li avatar May 18 '20 06:05 yanlong-li

Those on older PHP version can use a simpler function as below in "ASDecoder.php" . I used it on PHP 7.0 It will return an array instead of the object.

public static function getAppleSignInArray(string $identityToken) 
{

    $identityPayload =  self::decodeIdentityToken($identityToken);
return (array) $identityPayload;
}

yosus avatar Jun 20 '20 08:06 yosus

Those on older PHP version can use a simpler function as below in "ASDecoder.php" . I used it on PHP 7.0 It will return an array instead of the object.

public static function getAppleSignInArray(string $identityToken) 
{

    $identityPayload =  self::decodeIdentityToken($identityToken);
return (array) $identityPayload;
}

This function does not exists inside ASDecodes.php, did I get it wrong?

Can't get it to work on PHP 7.1

djunior97 avatar Sep 18 '20 20:09 djunior97

Hope support php7.1.

sn01615 avatar Aug 10 '21 08:08 sn01615