Request and Approval from user - flutter

I'm developing and app using flutter and firebase as the backend. I've got to the point where the current user can fetch the data of another user.
Now I want to impliment a function where at the click of a button, the current user sends a request to the the other user(something like a friend request). And also the current user can cancel the request. The the other user will then acdept the request or reject. Can anyone help me please.
I tried to find out from YouTube but all I got was sending notification to devices.

Related

facebook callback_url is not called for real time updates via app subscriptions?

I am fairly new to fb app development and I am trying to get real time updates from my page via app using subscriptions. So I created a subscription first which works fine and I got success, it calls my localserver for the verification.
and when I see subscriptions on app it shows the following output which I guess is correct.
Now this app is added on my fb page so once I go to tab my POST request is called,
Since I have subscribed to feed,name which means any new post or change in page name will trigger a POST request to my callback_url whcih is not happening, please let me know what I am doing wrong.
UPDATE:
just an update my callback url is now hit by facebook but I am not getting any useful object in JSON
JSON:{"bufferSize":8192,"contentWritten":0,"status":200,"committed":false,"outputStream":{},"locale":"en_US","finished":false,"headerNames":[],"characterEncoding":"ISO-8859-1"}

Facebook apprequest (notification) is it possible? [duplicate]

As it is possible to post on users wall without the request dialog using FB.api('Id/feed...), is it possible to send users an apprequests through the FB.api? and not FB.ui(apprequests...).
Thank you for your answer. I really need help on this I have been looking around for weeks...
You can send apprequests from user to user and app to user.
The apprequests from user to user are initiated with the Requests dialog box
App to User Requests can be used to re-engage a user in your app and can only be sent to users that have installed the app. For example, notifying a user that something has changed since their last visit, "10 of your friends are now online".
You can post a apprequest for a user by issuing an HTTP POST request to /USER_ID/apprequests with the app's access_token.
It is currently not possible to send *apprequest*s without the dialog.

How to send notifications on Facebook when User is offline?

I'm making an app that will integrate with the system I've got.
The idea is that in some events that occur within my system, the app can send notifications to users via Facebook.
That is, my app does not necessarily have to have something inside Facebook, the initial idea was only notify the user by Facebook about some event in my system, and when the user clicks on the notification, it would be redirected to my system.
Is this possible? Cause I'm having trouble keeping the Access Token, because those events will occur mostly when the user is offline, and if Access Token I have are invalid for any reason, I will have to get a new one because there is no as the user "re-authorize" my app because it would not be online at the time of the event.

Is it possible to post message to facebook when the app is running in background

I'm using facebook API. I want to submit some message to facebook when the app is running in the background. The problem is every time user request or submit a message to facebook, there will show a popup Webview. User need to click it again. So I want to skip this view and submit message in the background . Is this Possible? Can anyone give some suggestions?
Simply request publish_stream permissions from the user and then you can post on the user's behalf at any time, even when the user is not actively using your app (of course this is from a previous user request to have something posted on their behalf). Once you have publish_stream then do an HTTP POST to http://graph.facebook.com/USERID/feed?access_token=AppAccessToken with a message post parameter of the message to be posted to their feed.
As I know, application can not do anything but reciving notifications and presenting pushnotifycations during being in background. The only thing you can - is to ask user "open application rught now to post message to facebook" or something like that.

Sending application requests that appear in the left column on Facebook home page?

At the left column on facebook's home page, a notification from Facebook applications appears with a gray character, for example, "APPLICATION NAME [1]".
For example, Badoo app displays this type of notification when a friend has answered my question.
How do I display this notification for my own application?
Your English is great, hkweb. To send the user a "Notification", you must send a POST request to the user's /apprequests connection. You'll need a valid access_token for the user and this user must have "installed" your application before you can send them notifications like this OR use the Requests Dialog. Afterwards, it's as simple as sending a POST to:
https://graph.facebook.com/{USER_ID}/apprequests?access_token={ACCESS_TOKEN}
or
https://graph.facebook.com/me/apprequests?access_token={ACCESS_TOKEN}
The only required parameter to be sent is "message", but you can also send a JSON-encoded dictionary of parameters in the "data" parameter. I recommend you play with the API Graph Explorer. There you can send yourself apprequests with a POST, check your pending ones with a GET and clear pending requests with a DELETE request to
https://graph.facebook.com/{ID_OF_REQUEST_OBJECT}
If you're developing an application on Facebook (like a canvas app), you can make use of the Requests Dialog which makes sending the POST very easy and gives you a friend selector as well.
You can also get the user's pending apprequests by sending a GET request to the same object.