I am using php code for fb marketing api and facing this deprecation issue
Deprecated: read is being deprecated, please try not to use this in new code.
use FacebookAdsObjectAdAccount;
use FacebookAdsObjectFieldsAdAccountFields;
$account = new AdAccount('act_<AD_ACCOUNT_ID>');
$account->read(array(
AdAccountFields::TOS_ACCEPTED,
));
// Dump TOS Accepted info.
var_dump($account->{AdAccountFields::TOS_ACCEPTED});
Have they updated their code somewhere else? what should I use instead of read
function? Thanks.
2
Answers
The API successfully return the field about TOS, probably a deprecation of the SDK Library, try this (I take it from an example in the repo):
The read function is deprecated from the SDK
You should use the getSelf instead of this.
They have mentioned this in the sdk files on line 277 of https://github.com/facebook/facebook-php-business-sdk/blob/master/src/FacebookAds/Object/AbstractCrudObject.php
You can find documentation related to other deprecated functions over there.