Facebook app request was accepted but won't go away - facebook-apps

I created a web application that integrates with a functionality to invite my Facebook friends. The request is sent to a friend, friend accepts the request, but on his right sidebar on the Facebook homepage, the request won't go away. The request on his Apps and Games page persists too.
Is there something I should send as callback to delete the accepted request or does Facebook do that automatically?

Yes you have to delete the request, see the documentation here:
https://developers.facebook.com/docs/requests/#deleting
https://developers.facebook.com/docs/howtos/requests#delete_requests

Related

What is callback url in instagram api and how to can I implement it

Hi I'm beginner programmer
I'm trying to use instagram's realtime Photo Updates api
My purpose is use this API CONSOLE's subscription method
https://apigee.com/console/instagram
But I can't understand and handle callback url
What is the callback url's function?
And How can I implement the callback url?
The "callback url" (also referred to as redirect_url), is the URL Instagram will send users to after they have logged into Instagram, and authorized your application to read their data.
This is part of the OAuth 2 Spec, which Instagram (and many others) use to control access to their API.
The short version of the OAuth 2 "flow" is this:
You send a user to Instagram's page with your application ID, and a redirect URL.
The user logs into Instagram on their page and authorizes your application.
Instagram will then send the user back to your application (using the redirect URL value), along with a token that you can use to access their data.
GitHub has an excellent guide to how OAuth works on their server, which you will find very similar to Instagram's.
So the "callback url" should be set to the URL of your application server. For example, http://myapp.com/auth. Or, if you are working locally, you would use http://localhost:3000/auth.
Note: With Instagram (as well as most other APIs), the callback URL is permanently set when you register your client. So you'll often have to create separate clients for your live server, and your local one.

The use of FacebookAuthProvider in apps

I've been working with ServiceStack for quite some time now and i love it. But there is one thing i can't figure out.
How are app's (ios, android etc.) that are using my servicestack endpoints, suppose to use the facebook endpoint "/auth/facebook"?
When using this url "/auth/facebook" from the browser it works fine, but the response is html, and not an AuthResponse og something serializable.
Is this endpoint only to be used from websites with servicestack in the same solution?
The way that stuff works is by redirecting the user to Facebook with an API key that matches your app. The user then tells Facebook that your app is ok, and Facebook redirects them back. This can only be done via a browser. You really have two options to work around this:
Make the user authenticate with Facebook using a website and then authenticate your user with credentials from the app.
Use the built in iOS Facebook stuff and send the resulting auth tokens to an endpoint on your app, where you can save them for later use.
Edit, a bit more clarification:
Option 1
User Goes to your website
User Clicks on your Auth With Facebook button
User is sent your your Facebook endpoint set up in Service Stack
User is redirected by Service Stack to Facebook
User is redirected back to Service Stack from Facebook, with a token in the url
You save the token in your database and tell the user they can now user your app with Facebook.
Option 1.5
The same as Option 1 but instead of making the user go through their browser you create a UIWebView control and point it to your Facebook Auth endpoint. Then you listen for a response from your site that says the user is authenticated. I'm not a objective c, so I can't really get more detailed on how to do that.
Option 2
Use the iOS Facebook API and handle authentication as seen here.
POST the credentials to Service Stack via a Custom Endpoint
Save credentials in the db, and use them in the future to make calls on behalf of the user.
Facebook Login requires a browser of some sort, because Facebook's cookies must be passed along with a request to authorize your website. That is how Facebook knows which of it's users wants to authorize your site, and that they are the ones making the request.

Soundcloud popup_callback.html not redirected to callback url after Facebook login

my first post after years of reading :P
I think that are some problem with the page of soundcloud https://soundcloud.com/popup_callback.html
My app uses the soundcloud api and work fine, but when my users try to connect with facebook and they are go from facebook to
https://soundcloud.com/popup_callback.html?returnTo=CALLBACK_URL
but it is not redirected to the callback url, only show a empty page.
Users need login in soundcloud in other window before to make login in my app.
Can be a problem my callback url? "http://domain.com/callback/"
I try it in ff, opera and chrome and diferents at S.O.
This seems to be a bug in the SoundCloud API (see Soundcloud: blank page with popup_callback.html when trying to auth using Facebook)
I was able to work around this by including display=popup in the querystring when redirecting to SoundCloud's OAuth2 authorization endpoint: https://soundcloud.com/connect?client_id=[my_client_id]&redirect_uri=[my_redirect_uri]&response_type=code&display=popup. This will force the mobile optimized display to show up, but fixes the Facebook login issue.
Note that I'm not actually opening a popup window, I'm just including this param when doing a client-side redirect using window.location='https://soundcloud.com/connect?...&display=popup'

Send Facebook friend request via iPhone app?

I'm trying to add a friend request feature to one of my apps. I've done quite a bit of research, and I've found out that I can't do that via the graph api. I've also looked into dialogs, and that isn't supported in FBConnect.
So my only option now would be to pop up a UIWebView and do it and format the url like this: http://www.facebook.com/dialog/friends/?id=FRIEND_ID&app_id=APP_ID&redirect_uri=REDIRECT_URI. That's not a problem, but if the user isn't logged in with Facebook on mobile safari, they will have to log in and that can get quite annoying.
Have any others dealt with this problem? Any good work-arounds?
Friend requests always need to be authenticated from the request sender side, hence the user will have to log in when using the friend request dialog if they are not already logged in.

Facebook RESTful API require_login() callback

I'm trying to authenticate a user through the RESTful API (not Connect) but I can't since the callback system does not work for me. I have a local app that creates the Facebook API object with my key and secret, then calls the Facebook API require_login() method; I am sent to Facebook login, I login, and then I am sent to http://www.facebook.com/login.php?auth_token=<...>, where there's another login with just a field for password (not username), I write it again, and after that I am redirected to normal Facebook home. What am I doing wrong? I have set the callback URL in the Facebook app proprieties. Does it have anything to do with the fact that it's localhost?
Thanks!
Yes, if you tell facebook to go to localhost, it has no way of knowing where to go. Is your app fbml or iframe? If iframe I'm guessing there's a remote chance that localhost would actually work since the frame loads and then your browser can find localhost. I'm not sure of that, I wouldn't bother trying. But if it's fbml, Facebook needs to be able to hit your server. Give it your external IP instead.
I managed to make the redirect in the end. It appears the "Canvas Callback URL" is what I needed to set, and not the Authentication one.