codefog / contao-instagram

Contao extension that displays Instagram feed on your website
MIT License
11 stars 12 forks source link

Likes & Comments missing #26

Open Metis77 opened 4 years ago

Metis77 commented 4 years ago

since the update, data for the likes and the comments seem to be missing. before we could use the $item['likes']['count'] and $item['comments']['count'].

Is this information still available in the new API? Would it be possible to add them again?

qzminski commented 4 years ago

It should be added in bfdf7b7, you can test it before I release a new version.

Metis77 commented 4 years ago

in <?php $this->showTemplateVars(); ?> the fields comments_count and like_count are not yet available. Cleared Cache, updated DB.

qzminski commented 4 years ago

I noticed that the Instagram API does not contain that information but I thought it was specific to my test account. Yet I will have to further check why the data is not returned.

qzminski commented 4 years ago

Okay it seems that for every media item a separate request is needed. However when I do that, I get an error:

Tried accessing nonexisting field (comments_count) on node type (Media)

… which could be related to the missing instagram_basic and pages_read_engagement permissions https://developers.facebook.com/docs/instagram-api/reference/media#returnable-fields

I am not able to verify my app and I don't have any other idea what could be wrong. Thus this issue will remain open until somebody can shed some light on this.

Metis77 commented 4 years ago

I could offer my App Credentials and add your testing Domain to the app, if that would be of any help.

qzminski commented 4 years ago

Has your app been verified by Facebook and is approved/public?

Metis77 commented 4 years ago

Oh I see. Sorry, my app is in devmode.

Facebook has changed what is can be read in devmode. Metadata like likes and comments can no longer be read in devmode.

Features can be used by apps while in Development Mode, with the exception of Page Public Content Access and Page Public Metadata Access, which can only be used while in Live Mode.

Requesting live mode for every app / user that uses your plugin, might be unrealistic.

Maybe this plugin could come with its own public facebook app, that anybody could use. Alike is discussed for another contao facebook plugin by @m-vo: https://github.com/m-vo/contao-facebook-import/issues/16

qzminski commented 4 years ago

If that is the case then I guess we cannot do much about it as of now. I will leave this ticket open though, maybe somebody has an idea how to solve that other way.

fritzmg commented 4 years ago

The pages_read_engagement permission is only granted with business verification, for which you may need to sign additional contracts. It might be difficult to get.

qzminski commented 4 years ago

So this in fact could be implemented as an optional checkbox in the module settings, yet I would need a test account that has enough permissions. If anyone has a verified account, please let me know 🙂