Facebook integration
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 38
- Joined: Thu Jun 28, 2012 2:48 pm
- Location: West-Cork, Ireland
- Contact:
Facebook integration
Hi,
I'm building a kiosk application for an exhibition that will allow visitors to send an electronic card via email and should share it on their Facebook account which will run on a Surface 3 running Windows10.
Therefor the app should be able to login to the user's Facebook account by providing their details [which will be deleted straight after posting]. I know about the facebooklib from Andre Garzia and happy to buy that but would like to clarify a few things before doing so as I'm not getting a clear view on this.
- Do I have to register the app on Facebook and get an appID.
- Does the app then need to be submitted to Facebook for approval?
- Should I register the app as the developer or should that be my client who will be running the app at the exhibition? Or does that not matter.
- Or is there a simpler way of posting an image onto a user's timeline bearing in mind it's not just one user using the app.
Many thanks,
Bert
I'm building a kiosk application for an exhibition that will allow visitors to send an electronic card via email and should share it on their Facebook account which will run on a Surface 3 running Windows10.
Therefor the app should be able to login to the user's Facebook account by providing their details [which will be deleted straight after posting]. I know about the facebooklib from Andre Garzia and happy to buy that but would like to clarify a few things before doing so as I'm not getting a clear view on this.
- Do I have to register the app on Facebook and get an appID.
- Does the app then need to be submitted to Facebook for approval?
- Should I register the app as the developer or should that be my client who will be running the app at the exhibition? Or does that not matter.
- Or is there a simpler way of posting an image onto a user's timeline bearing in mind it's not just one user using the app.
Many thanks,
Bert
Re: Facebook integration
Yes- Do I have to register the app on Facebook and get an appID.
Yes, but usually this isn't a big deal if you're just sharing something simple like a picture or a link.- Does the app then need to be submitted to Facebook for approval?
Probably, you should register the app, because that's easier for your client.- Should I register the app as the developer or should that be my client who will be running the app at the exhibition? Or does that not matter.
The only other way is to have a website open in an internet browser and ask the user to press a button on that website to share it. The website can be made in such a way that the desired picture is shared in the user's timeline. If you want to share something directly from within your app, you'll need a lib to authorize your app to post on the user's timeline.- Or is there a simpler way of posting an image onto a user's timeline bearing in mind it's not just one user using the app.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 38
- Joined: Thu Jun 28, 2012 2:48 pm
- Location: West-Cork, Ireland
- Contact:
Re: Facebook integration
Hi Mark,
Thanks for your reply.
Bit late in getting back about this here, been a busy time.
I'm going with the facebooklib from Andre Garzia for the Fb integration but one thing I don't seem to get on Facebook's developers application page is which type of app to choose. When I pick Windows it asks for a Windows store ID, which I won't have as it not a publicly available app.
If I pick web, as the login happens thorough the embedded browser it asks for a URL which I also won't have so not sure how to get past this hurdle?
Any help appreciated.
Bert
Thanks for your reply.
Bit late in getting back about this here, been a busy time.
I'm going with the facebooklib from Andre Garzia for the Fb integration but one thing I don't seem to get on Facebook's developers application page is which type of app to choose. When I pick Windows it asks for a Windows store ID, which I won't have as it not a publicly available app.
If I pick web, as the login happens thorough the embedded browser it asks for a URL which I also won't have so not sure how to get past this hurdle?
Any help appreciated.
Bert
-
- Posts: 38
- Joined: Thu Jun 28, 2012 2:48 pm
- Location: West-Cork, Ireland
- Contact:
Re: Facebook integration
Hi,
Ok, so have it mostly working now. Picked web for app type on Facebook which seems to work fine, I'm able to post to my timeline.
The only thing I'm stuck with now is how to log out of Facebook so next time I come back, I'm not automatically logged in as me. Andre's FacebookLib has a logout function but that doesn't seem to do the trick or maybe I'm using wrongly.
If anyone has any experience with Andre Garzia's FacebookLib I'd appreciate the help!
Bert
Ok, so have it mostly working now. Picked web for app type on Facebook which seems to work fine, I'm able to post to my timeline.
The only thing I'm stuck with now is how to log out of Facebook so next time I come back, I'm not automatically logged in as me. Andre's FacebookLib has a logout function but that doesn't seem to do the trick or maybe I'm using wrongly.
If anyone has any experience with Andre Garzia's FacebookLib I'd appreciate the help!
Bert
-
- Posts: 38
- Joined: Thu Jun 28, 2012 2:48 pm
- Location: West-Cork, Ireland
- Contact:
Re: Facebook integration
Hi,
Just wanted to bump this really as I'm stuck with the logout of Facebook.
If anyone knows of a way to clear the cache for the revBowser [where would the cache be located on Windows 10, I could delete it from there] that'd be great.
Or if someone has experience with the FacebookLib and managed to get the logout function to work. It doesn't log me out at the moment.
Thanks!
Bert
Just wanted to bump this really as I'm stuck with the logout of Facebook.
If anyone knows of a way to clear the cache for the revBowser [where would the cache be located on Windows 10, I could delete it from there] that'd be great.
Or if someone has experience with the FacebookLib and managed to get the logout function to work. It doesn't log me out at the moment.
Thanks!
Bert
-
- Posts: 38
- Joined: Thu Jun 28, 2012 2:48 pm
- Location: West-Cork, Ireland
- Contact:
Re: Facebook integration
Just in case someone else needs it, the cookies stored on Windows (10) from the revBrowser are in here:
C:\Users\USERNAME\AppData\Local\Microsoft\Windows\INetCookies
If I delete the cookie created by the Facebook login, I won't be auto-logged in next time and get a blank login again.
EDIT: I also had to delete the Facebook stack from memory to clear any variables and start afresh.
Bert
C:\Users\USERNAME\AppData\Local\Microsoft\Windows\INetCookies
If I delete the cookie created by the Facebook login, I won't be auto-logged in next time and get a blank login again.
EDIT: I also had to delete the Facebook stack from memory to clear any variables and start afresh.
Bert
-
- Posts: 32
- Joined: Fri Jan 16, 2015 5:31 pm
Re: Facebook integration
What I finally discovered at http://keganzo.blogspot.pt/2012/03/work ... t-url.html was that you can use a URL scheme to delete an access token using this format:bertBUSIbr8 wrote:Or if someone has experience with the FacebookLib and managed to get the logout function to work. It doesn't log me out at the moment.
Code: Select all
https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]
- 1 - gets my saved token from a preference file
2 - tell Livecode what the Site URL that was declared at dev.facebook.com for the Website platform of this App
3 - launches a browser with the logout link
4 - waits 2 seconds for Facebook to process the request (this was a guess, I assume there is some way to know when it has actually finished)
5 - removes the browser used for logging out
Code: Select all
set the defaultFolder to specialFolderPath("Documents")
put line 3 of URL ("file:iotPrefs.txt") into tFBToken // unique user token saved earlier
put "http://indianaontap.com" into tFBwebsite // this Site URL is unique for my Facebook app
put "https://www.facebook.com/logout.php?next=" & tFBwebsite & "&access_token=" & tFBToken into tURL
launchBrowser tURL
wait 2 seconds // this was how long it was taking my browser to connect... no delay here and the token didn't get deleted
_fbKillBrowser
-
- Posts: 38
- Joined: Thu Jun 28, 2012 2:48 pm
- Location: West-Cork, Ireland
- Contact:
Re: Facebook integration
Oh! Very good.
Two solutions now. Will have to have a look at yours and give it a try. Probably more elegant than my slightly more brute force?
Bert
Two solutions now. Will have to have a look at yours and give it a try. Probably more elegant than my slightly more brute force?
Bert
-
- Posts: 32
- Joined: Fri Jan 16, 2015 5:31 pm
Re: Facebook integration
Correction: this needs to be a 1,2 punch in order to be effective.
In addition to the code above to clear the cookie from the browser, I also needed to delete the token from the app (I only deleted it from my preference file in the last example). Add the following code inside your fbLogout handler or wherever seems appropriate for your needs.
When I didn't add this code, the cookie was removed from the browser but the token still worked and was being used to authenticate....saved in the depths of the FacebookLib {sDataA["token"]["access_token"]).
In addition to the code above to clear the cookie from the browser, I also needed to delete the token from the app (I only deleted it from my preference file in the last example). Add the following code inside your fbLogout handler or wherever seems appropriate for your needs.
Code: Select all
put EMPTY into tFBToken
fbSetAccessToken(tFBToken)