Get Realtime Updates from a Facebook page - facebook

I am working on a web app that use Facebook login. The purpose of the app is to get information about fan pages that the user has in his account (for which he got admin privileges). I work mostly with the insights informations but this is not the issue. Now I would like to receive realtime update from the page like new messages, page posts reply etc. I've read the documentation https://developers.facebook.com/docs/reference/api/page/#realtime
and I don't understand the part about adding the app to the page. It is required that the app to be installed for example in one of the tabs? If so, is there a way not to do that and still receive the informations that I want? Also when I try to create a Realtime Update Subscriptions for the page object no "posts" field was available, then how to get realtime updates about it? I am a little confuse and any guidance and advise is more than welcomed.
P.S. I am using PHP SDK, if this helps with something.

I've read the documentation
How about reading it again?
I don't understand the part about adding the app to the page. It is required that the app to be installed for example in one of the tabs? If so, is there a way not to do that and still receive the informations that I want?
Quote from the docs part you linked to yourself:
Note: You might think that because you're adding this via the tabs API that this is a tab app. It's not. This app isn't visible to users as a page app and isn't managed via any UI.
Also when I try to create a Realtime Update Subscriptions for the page object no "posts" field was available, then how to get realtime updates about it?
You can subscribe to the page’s feed.

Related

Proper login architecture with Firebase then (Instagram) in Flutter

Let me explain what I'm trying to do. I have an app that users Firebase to authenticate users. When a user logs in, though, the user has to link an Instagram account in order to proceed (the app does things with Instagram data). The question is not about how to do the actual login with either Firebase or Instagram, the question is about how to structure my app so the workflow works. My current workflow relies on a root page listening on a stream for changes in the Firebase user and returns the corresponding page depending on the situation. This is not really what I want for two reasons. 1) It's broken; the pages don't actually return when they're supposed to (this might be because I have a FutureBuilder inside a StreamBuilder so it's getting confused?). If I reload the app, however, the state did change and it loads the correct page. 2) Doing this I have to go directly from the create account page to the linking page. I want to go back to the login page in order to confirm accounts by sending an email before proceeding with the Instagram linking process. In summary, here's some pseudocode for what I'm trying to do:
Root Page:
If user is logged in:
Go to Link Decider
Else:
Go to (Firebase) Login Page
Link Decider:
If user is logged in with Instagram:
Go to Home Page
If user has Instagram account linked to Firebase but is not logged in:
Go to Log in with Instagram Page
If user hasn't linked Instagram:
Go to Link Instagram Page
Instagram Link/Login Pages:
Do login then go to Home Page
Sorry for the long question I've just been trying a lot of things and nothing seems to work so I figured someone else might have a better idea of how to do this. If you want to see some concrete implementation I can add it but I don't think it's necessary (since I'm trying to do this a better way not fix my wacky one). Any help is very much appreciated. Thank you!
If you want my opinion, follow the Flutter Firebase & DDD Course series in the below link. I have learned a lot from this website with regards to architecting your application
Flutter Firebase & DDD Course

How to set up a facebook app for an existing fan page to track ad clicks/installs?

I’m trying to set up and link the facebook sdk in some existing mobile apps to an existing fan page. I’m an admin for the fan page, so I have access to https://www.facebook.com/analytics/page_a_id/ for that page. I want to be able to track ad clicks —> app installs. I got a new app working with the sdk setting it up through https://developers.facebook.com/apps/app_b_id/dashboard/. But I want it to be linked to the first page, not a new app. How can I create an app and link it to that already existing fan page? I have followed the instructions from this answer (https://stackoverflow.com/a/13904144/419194), and I was able to successfully see the page I want to connect on https://developers.facebook.com/apps/app_b_id/settings/advanced/ . However, events from the facebook sdk on Android still are reported in the analytics page for page_a_id. Why is this? Is there anything else I have to do? Or am I just misunderstanding how this all works entirely?
And just to keep me sane, this is the correct process, right? I only want to be able to feed the sdk into the analytics. I feel like many other people must have done this, but there seems to be a lot of confusion from various SO/FB help posts.

Facebook app id for website social plugins

I have like/share buttons on my website and am not currently using an appid. Finding information on whether this is a necessity for the above configuration is difficult to confirm. When going through the Facebook app "create" forms, I'm really confused by a lot of the requirements as it seems to be more focused around actual apps rather than websites, which login via fb etc.
In the past I have created an app for one of my other websites and I don't believe there was any verification/submission process at this point (about 2-3 years ago). Reviewing my old app configuration now I can see that it is not "live" - does anyone know whether Facebook implemented this submission process in the last couple of years, and then de-activated any live apps that were created prior to this?
I now want to setup a new app for my new website and I'm unsure what the different 'action types' mean and what I would need to simply use like/share buttons on the website. Could someone give me a quick run down of what I'd need and what they are?
Any other info/tips people can provide would be greatly appreciated. I'm finding that the like/share DO still work without the app, but sometimes the share button doesn't work properly (I have a feeling this is something to do with the app).
Thanks
If you are just using the Social Plugins, you don't need to have a Facebook App ID.
If you want more integration, it will be required. Creating an App ID is like registering your App, wether an iOS or Android App or just a website, so that you can make Graph API calls for it.
The easiest way to register your website is to go the quickstart: https://developers.facebook.com/quickstarts/?platform=web (or https://developers.facebook.com/apps). There you can type a name and follow the steps.
You can then follow the "Sharing best practices" (https://developers.facebook.com/docs/sharing/best-practices#tags) on how to use the App ID. For example, by including an fb:app_id meta tag on your pages.
There is a review process, since last April, but that is only needed if you use permissions for your App. If you just use the plugins, that is not needed.
Can you explain more what is exactly not working?
Update
The time you create a page the Facebook crawler does not know yet what the Opengraph data for that one is. This will happen after the first share, but if you want to ensure it is correct from the first share on, you can force a re-scrape.
This section explains how that works:
https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
When an app triggers a scrape using an API endpoint This Graph API
endpoint is simply a call to:
POST /?id={object-instance-id or object-url}&scrape=true

Facebook UI documentation

I am trying to create a bookmarklet to process some Facebook data about my contacts, what will possibly require to load another profile pages and see who my friends are.
I am trying to know which urls should I query to get this information. And also how to interact with FB's UI libraries and/or elements.
Is there any documentation for this?
You probably are looking for Facebook JavaScript SDK.
Here is documentation on the FB.ui(): http://fbdevwiki.com/wiki/FB.ui
EDIT: it's updated by user contributions and lately it hasn't been changed much

Facebook Connect - Add events to an Events Page (not profile)

I have created Facebook pages with an events tab. I am currently trying to add events to this events page via the Facebook connect API but can't work out how do it.
I can add events to my profile no problem.
Can anyone tell me how to add events to a page, is it possible?
Alternatively is there a way I can add an event to my profile and have my page automatically pick up this event (I can't see anything in the settings for this?).
Any help very much appreaciated!
Thanks
C
Current API doesn't support this as far as I can see.
There is an API function which is in beta at the moment (but doesn't seem to be working as
yet) which according to the documentation is designed to publish a post into the stream on the wall of a user, group, page or event, so this should provide the functionality needed.