Facebook connection

Previous topic - Next topic

Moebius

Posted in some answers thread was a link to this php script:  http://pastie.org/619912
It deviously logs in to facebook.  Perhaps a php script could read ENCRYPTed username, password, and appid values and handle login, permissions, etc. automatically?  Looks difficult though (emulating a browser requesting the pages....)
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

spicypixel

The code you posted Serpent is hard-coded with the login info. Using my script asks the user for their permissions to allow the app this is the correct way of doing things.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Kitty Hello

So we have a script that's useable for all users here and has no security/privacy leaks?

Moebius

QuoteThe code you posted Serpent is hard-coded with the login info.
I meant if you wanted to avoid opening a web browser, you'd have to hardcode your own dodgy login + grant permissions script - not recommended nor easy...  :P
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

spicypixel

Quote from: Kitty Hello on 2011-Jul-18
So we have a script that's useable for all users here and has no security/privacy leaks?

the facebook.php script is part of the facebook sdk and it already has checks for security within it so is safe to host. The other files will have to be hosted by each user as effectively they have unique app id's and such created within facebook.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Omadan

#20
Hows this going spicy?
Ok with Glbasic v10 I can pause program, run Netwebend "url" and post to facebook successfully. A big problem though, I can't return control to glbasic unless I click the actual screen. This im sure is not going to work on iOS, havent tried though. Been testing on PC only. Another problem is theres no interaction whether if post has been successful or not. Doing this with netwebend is very hard to control. I want to exit Facebook, return control to glbasic app together with a value to be read by GlBasic to verify if post to facebook has been successful. How to do this is whacking my brains,  :rant: and maybe its not even doable with Netwebend.
your feedback is greatly appreciated.
Top Arcade Apps - Best game for mobiles and computers

http://www.toparcadeapps.com

Omadan

Damn. just as I thought. I compiled for Xcode. I can post but I stay in the Facebook page. I cant exit it and return to the app, even though it is running.
Top Arcade Apps - Best game for mobiles and computers

http://www.toparcadeapps.com

spicypixel

Quote from: Omadan on 2011-Jul-20
Damn. just as I thought. I compiled for Xcode. I can post but I stay in the Facebook page. I cant exit it and return to the app, even though it is running.

Ive been busy with work but I'll look into ways to post via glb other than using netwebend
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Omadan

Tried again today. No Success. Netwebend will not work. I can post but cant restore control to my App in iOS.
Netwebget$ and Netwebget will definately not work as you need to run php script from the browser. Been trying for hours. Anyone would know what to do?
Top Arcade Apps - Best game for mobiles and computers

http://www.toparcadeapps.com

Slydog

#24
Well, an easy solution would be to only post when your app exits.
Just queue up the posts and post them all at the same time.
Of course this may not be ideal for everybody and every situation!

[Edit] Hmm, well I'm guessing you couldn't actually post more than once at the end, unless the GLB code is still running in the background after the first post to continue posting the remainder.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Omadan

Thanks Sly. But that won't work for what I want. Firstly no one wants a Facebook login screen when exiting the app. Plus asking person if they want to post to facebook upon exit is not a good idea. And the most important crucial thing is I have intentions of giving something when user posts. Im happy he is happy. Thats the way to encourage. Now how Im I going to do that upon exit :(. I really don't know what to do. Really need some pro help here.

Anyone?   :'(
Top Arcade Apps - Best game for mobiles and computers

http://www.toparcadeapps.com

Kitty Hello

well, you can still try to do it in php and just call that website to post a string automatically. No?

spicypixel

There is a facebook iOS SDK but I know nothing about Objective C to begin implementing it. This is the correct way of doing it but I could only work on the php side of things which is why I chose the web solution. I'm curious to know how people are posting high scores to a web based table though as effectively they should run into the same problems as mentioned here.

I know you could use the TCP socket commands to send and read data to and from the php script which wouldn't exit your app, but it would mean parsing the permissions html screen when first shown by facebook in code. Not a nice bit of coding to do.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Omadan

For my online scores I use netwebget$ and works like a charm, but theres no need to call a web browser there.
With this however we need to pass info via a browser and thats the problem.
How could we implement the Facebook iOS SDK? Because to be honest Spicy, this is the way to do it, just as you mentioned earlier. Anyone knows how to do this for use with Glbasic? Please this is an interesting thing for glbasic. If someone at least knows and maybe tell me what I need to do step by step I would do it. At the moment I havent imported anything so quite null on the matter.

Hope this can be sorted my game is almost finished. Thanks
Top Arcade Apps - Best game for mobiles and computers

http://www.toparcadeapps.com

Moebius

NETWEBEND isn't that bad.  There is multitasking on iOS and on Android, and at least it will work on all platforms.

The platform specific FB APIs (i.e. iOS and Android) won't work with others, and both involve the user using the facebook apps on those devices to sign in.  Perhaps a good approach would be using "Web Views" (if anyone is familiar with that) if you want an easier way to do platform specific FB logins...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary