It is currently Wed May 22, 2013 1:51 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Facebook connection?
PostPosted: Fri Feb 10, 2012 4:34 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 03, 2003 7:45 pm
Posts: 228
Location: Germany
Hy everybody,

I just started to read about the facebook api.
Did anybody already get a purebasic program to post on facebook?

I would like to post new highscores of our users to facebook if they like that.
So I need the program to read in username/password and after that do that oauth stuff.

Just would like to know if somebody already did this successfully and maybe give me some hints.

Cheers,
Markus

_________________
http://www.lostlabyrinth.com


Top
 Profile  
 
 Post subject: Re: Facebook connection?
PostPosted: Fri Feb 10, 2012 4:37 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jan 21, 2011 8:25 am
Posts: 548
It's pretty straight forward actually. There is a whole documentation
about all the API stuff on Facebook itself, just check it out. :)

I tried it a couple of years ago and it was rather easy,
but I don't think I ever saw any examples around here.

_________________
Image
ImageImageImage
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds


Top
 Profile  
 
 Post subject: Re: Facebook connection?
PostPosted: Fri Feb 10, 2012 5:09 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 03, 2003 7:45 pm
Posts: 228
Location: Germany
As I see it I have to do something like that:

Code:
Desktop Apps

Our OAuth 2.0 implementation does not include explicit desktop app support. However, if your desktop app can embed a web browser (most desktop frameworks such as .NET, AIR and Cocoa support embedding browsers), you can use the client-side flow with one modification: a specific redirect_uri. Rather than requiring desktop apps to host a web server and populate the Site URL in the Developer App, we provide a specific URL you can use with desktop apps: https://www.facebook.com/connect/login_success.html.

    Embed a web browser and load the OAuth Dialog (https://www.facebook.com/dialog/oauth) using the client-side flow (i.e. response_type=token):

https://www.facebook.com/dialog/oauth?
    client_id=YOUR_APP_ID&
    redirect_uri=https://www.facebook.com/connect/login_success.html

    After the user authorizes your app, we redirect the user back to the redirect_uri with the access token in the URI fragment:

https://www.facebook.com/connect/login_success.html#access_token=...

    Detect this redirect and then read the access token out of the URI using whatever mechanisms provided by your framework of choice.


No clue yet how I embed a browser in purebasic.

_________________
http://www.lostlabyrinth.com


Top
 Profile  
 
 Post subject: Re: Facebook connection?
PostPosted: Sat Feb 11, 2012 7:00 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 09, 2007 2:15 am
Posts: 236
Brujah wrote:
No clue yet how I embed a browser in purebasic.


WebGadget() ?

_________________
English is not my native language...
ImageImageImage


Top
 Profile  
 
 Post subject: Re: Facebook connection?
PostPosted: Wed Feb 15, 2012 5:17 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Nov 03, 2003 7:45 pm
Posts: 228
Location: Germany
Yes. this should do the job.

I have a problem that my kubuntu shows only an empty window when I start the testprogram.
Probably a gtk lib is missing here.
No clue though which one this could be :(

_________________
http://www.lostlabyrinth.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye