Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] Facebook API

(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
So lately I have been into making an app for facebook.

I was wondering if anyone could help me make a page that does following:

  • If user is new to app, ask for full permission to access info online/offline, send wall posts
  • If user has already added application just show his name or something.
I have tried using login button, but I would like to see like a permission thing popup right away.
 
Junior Spellweaver
Joined
Oct 31, 2010
Messages
130
Reaction score
6


Have you tried?
 
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Yes but I want to redirect user to "Request for Permission" page directly without having him to click on the login button as shown in example.
 
Junior Spellweaver
Joined
Oct 31, 2010
Messages
130
Reaction score
6
You could directly call the script instead of having the user to click on login first.. should be simple with a few modifications, let me know!
 
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Tried following but redirects to facebook page:
PHP:
<?php
include_once "facebook.php";
 
$facebook = new Facebook(array('appId'=>'xxxxxxxxxxxxxxxxxxxxx','secret'=>'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx','cookie'=>true,'domain'=>'jm2.me'));
 
$session = $facebook->getSession();

if ($session)
{
	echo 'In!';
}
else
{
	$url = $facebook->getLoginUrl( array( 'canvas'=>1, 'fbconnect' => 0 ) );
	header( 'Location: '.$url );
}
 
?>
 
Junior Spellweaver
Joined
Oct 31, 2010
Messages
130
Reaction score
6
Does it automatically check if the user is logged into facebook?
 
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
It doesnt check if user is logged into facebook. But it checks if application has permission to access user profile, etc

---------- Post added at 12:58 PM ---------- Previous post was at 11:33 AM ----------

Ohh wait ya it does. My bad
 
Back
Top