I use the following URL setting to authorize Facebook login. But the page for Application Authorization is webish, and not mobileish.
webview
.loadUrl("http://www.connect.facebook.com/login.php?return_session=1&nochrome=1&fbconnect=1&extern=2&connect_display=popup&api_key="
+ FConnect.API_KEY
+ "&v=1.0&next="
+ FConnect.SUCCESS_URL
+ "%3Ffb_login%26fname%3D_opener&cancel_url="
+ FConnect.CANCEL_URL
+ "%23fname%3D_opener%26%257B%2522t%2522%253A3%252C%2522h%2522%253A%2522fbCancelLogin%2522%252C%2522sid%2522%253A%25220.741%2522%257D&channel_url="
+ FConnect.XD_RECEIVER);
As you see this is webish, as I had to scroll to the middle,
alt text http://img100.imageshack.us/img100/2100/facebookconnect.png
Do you know the address to get a mobileish App authorization page?
According to the Facebook developer wiki, it says that you have to set your display parameter to "wap" if you're on the mobile.
I guess you would have to check if the user is on a mobile or a PC. If on a mobile, change the display parameter to "wap", else keep it to "pop-up".
Related
I use facebook API to Login in my project. But for long time, all user image in my project is broken image and get URL signature expired. Even though, I grab URL picture same in website facebook developer. And this is my code :
var profile_picture = "https://graph.facebook.com/" + response.id + "/picture";
Any solution for me ? because I really confused right now. Thank you very much.
I'm having a lot of trouble with connecting to the spotify api on my mobile app.
I have been able to successfully able to get a token with this url:
"https://soundcloud.com/connect?client_id=" + client_id + "&response_type=token&redirect_uri=" + encodeURIComponent(redirect_uri) + "&state=" + Spotify.State + "&scope=" + encodeURIComponent(scope) + "&display=" + display;
However, this requires the user to click on connect every time they log into the app. Is there not a way to only have them authorize the app once?
I'm assuming that's what /oauth2/token is for, but when I change my &response_type=token to &response_type=code (above) so that I can pass the code into /oauth2/token it returns a redirect error (works fine with token).
I've looked around for samples but they are hard to come by. Any help would be greatly appreciated, even a point in the right direction.
I'm referring to the HTTP API guide (https://developers.soundcloud.com/docs/api/reference). I don't want to use a javascript plugin.
I have done a huge amount of research regarding this issue but non of the answers worked for me.
I have created my facebook app and got the APP-ID now when I am constructing the URL to share a test image on facebook wall I keep getting this error
This dialog has been passed a bad parameter.
API Error Code: 100
API Error Description: Invalid parameter
Error Message: redirect_uri URL is not properly formatted
My constructed URL is
www.facebook.com/dialog/feed?app_id=' + '[MYAPPID]' + '&display=popup&caption=Check out this picture' + '&link=' + '[MYAPP].herokuapp.com/assets/wolf-391302847666d53202dab51e1ea4d8a8.jpg' + '&redirect_uri=' + '[MYAPP].herokuapp.com/' + '&picture=' + '[MYAPP].herokuapp.com/assets/wolf-391302847666d53202dab51e1ea4d8a8.jpg' + '&name=' + 'wolf' + '&description=' + 'wolf_description'
As it was prompted in one of the answers, I have created a website platform in my facebook app and added
[MYAPP].herokuapp.com/ to both site URL and APP domains.
I am also getting a warning while using an facebook debugger toll although I don't believe this causes the problem
he 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.
Any help is appreciated.
Thank you.
Never mind. I was having a type. Sorry for the false alarm.
Cheers.
I am building some forms using the html input tabs in Facebook.
My form actions are post and insert linking to externally hosted php
function files.
The problem is, if the user isn't using Facebook's new https setting, a pop up
is shown with "un secure form"
Is there a why to provide a secure handler externally hosted or is this something
I would have go deeper into Facebook ap making with?
Facebook loads your app into an iframe (using POSTing a form).
When the user is using https with facebook they use the Secure Canvas URL property from the app settings, and when the user is not on secure browsing they use the Canvas URL.
Because of that, your page is not loaded from https but http, which is why that warning is shown to the user by the browser.
What you can do is to check when your page is loading which protocol is used and if it's not https then reload the page from https.
Something like (using window.location object):
var location = window.location;
if (location.protocol != "https:") {
window.location.href = "https://" + location.host + "/" + location.pathname + location.search
}
Or if you don't expect to have urls in your querystring you can simply replace:
window.location.href = window.location.href.replace("http", "https");
I maintain an asp.net website and have a requirement to publish to the businesses facebook wall as the business.
We set up a facebook app to do so.
So what happens is after a user clicks a button on the website the program calls facebook with scope=publish_stream,offline_access,manage_pages parameter
Facebook returns a code
We call facebook again with something that looks like this
string.Concat("https://graph.facebook.com/oauth/access_token?client_id=" + facebookPostClientId,
"&redirect_uri=" + "blah.aspx", "&client_secret=" + facebookPostSecret, "&code=" + code )
Facebook returns an access token.
We then call facebook to get all the accounts with something like this:
https://graph.facebook.com/" + facebook_user_id + "/accounts?access_token=" + accessToken;
We then loop throught the accounts until we find the correct one and call facebook again with something like
https://graph.facebook.com/" + userName + "/feed?&access_token=" + accessToken + "&picture=" + picture + "&name=" + "Studentcard - Deal" + "&link=" + link + "&message=" + message + "&caption=" + caption + "&from=" + userName + "&to=" + userName;
It works after a fashion. IF the owner of the business who created the facebook app is logged on to facebook, then the processing works.
If anyone else is logged on then it doesn't.
The reason being that the bit where we call facebook to get all th accounts only works when the business owner is logged on to facebook.
I tried inserting the business owners facebook id inbto the code instead off the logged on users, but it doesn't work.
So what do I do? Is this the wrong way to go about this?
I realise this maybe a bit long winded, but I am new to facebook and am providing as much information as I think necessary.
Thanks in advance
Niall
The reason being that the bit where we call facebook to get all th accounts only works when the business owner is logged on to facebook.
Separate this part of the process. Get all the accounts, and then cache them in your database. Whenever you fail to get the accounts, just use the cached information and proceed normally (otherwise update the DB and proceed normally).