Unexpected App Id using Facebook PHP SDK API
The variable $config['app_id']
is undefined, use the app id directly:
$tokenMetadata->validateAppId(YOU_APP_ID);
When you assign your APPID as integer like this also, you will get an Unexpected App Id error.
$tokenMetadata->validateAppId(1034645623719);
You have to assign your APPID as string (within quotes) like this
$tokenMetadata->validateAppId('1034645623719');