EllisLab text mark
Advanced Search
7 of 11
7
   
Poll
Should I make the repository Spark friendly?
Yes 5
No 2
Branch off and create a "full" branch. 3
Total Votes: 10
You must be a logged-in member to vote
Facebook Ignited
Posted: 16 August 2012 10:42 PM   [ Ignore ]   [ # 101 ]   [ Rating: 0 ]
Joined: 2012-05-02
29 posts

Does this offer a built in method that redirects to canvas page if you make to make it just a facebook app? I did this but when facebook adds it’s own query , my app dosen’t load, might have to do if HTTP_REFERER contains apps.facebook.com it should be good to go.

<?php

$server_referer 
$_SERVER['HTTP_REFERER'];

if(
$server_referer === NULL || $server_referer !== 'https://apps.facebook.com/appName/' ){
 header
('Location: https://apps.facebook.com/sneakerdb/');
}
?> 

The reason for the above, is because if you go to the normal url, the site loads up all the normal stuff.

Also do you know how to get the extra permissions that are in this page https://developers.facebook.com/docs/authentication/permissions/#user_friends_perms the fb_me dosen’t have all of it even if I requested it in auth.

 
Posted: 17 August 2012 12:23 AM   [ Ignore ]   [ # 102 ]   [ Rating: 0 ]
Avatar
Joined: 2012-08-09
64 posts

isk i suck this OuO

 Signature 
 
Posted: 17 August 2012 03:08 AM   [ Ignore ]   [ # 103 ]   [ Rating: 0 ]
Avatar
Joined: 2009-10-10
20 posts
sweetD - 16 August 2012 10:42 PM

Does this offer a built in method that redirects to canvas page if you make to make it just a facebook app? I did this but when facebook adds it’s own query , my app dosen’t load, might have to do if HTTP_REFERER contains apps.facebook.com it should be good to go.

<?php

$server_referer 
$_SERVER['HTTP_REFERER'];

if(
$server_referer === NULL || $server_referer !== 'https://apps.facebook.com/appName/' ){
 header
('Location: https://apps.facebook.com/sneakerdb/');
}
?> 

The reason for the above, is because if you go to the normal url, the site loads up all the normal stuff.

Also do you know how to get the extra permissions that are in this page https://developers.facebook.com/docs/authentication/permissions/#user_friends_perms the fb_me dosen’t have all of it even if I requested it in auth.


Check permission does that, here an example (goes into your controller)

$this->fb_ignited->fb_check_permissions('read_stream, friends_likes, user_photos'true); 

If the user hasn’t installed the app or hasn’t given the permissions he will be redirected to the app authentification dialog where he can grant the permissions, once he has, he will be redirected to your app page on facebook (apps.facebook.com/myapp).

 

 
Posted: 17 August 2012 07:20 AM   [ Ignore ]   [ # 104 ]   [ Rating: 0 ]
Avatar
Joined: 2009-10-10
20 posts

hey deth4uall, I fixed the error I was getting myself:

192  if ($user)
193  {
194   
try {
195    $me 
$this->CI->facebook->api('/me');
196   } catch (FacebookApiException $e{
197    
if ($redirect == true)
198    {
199     
if ($script == true): echo $this->fb_login_url(true);
200     else: $loc $this->fb_login_url(); redirect($loc); endif;
201     exit;
202    }
++203    return false;
204   }
205   
return $me;
206  } 

I added return false in line 203 to the FacebookApiException, so fb_get_me() returns false when api exception occurs.

 
Posted: 17 August 2012 09:41 AM   [ Ignore ]   [ # 105 ]   [ Rating: 0 ]
Joined: 2012-05-02
29 posts
Kimmik - 17 August 2012 03:08 AM

Check permission does that, here an example (goes into your controller)

$this->fb_ignited->fb_check_permissions('read_stream, friends_likes, user_photos'true); 

If the user hasn’t installed the app or hasn’t given the permissions he will be redirected to the app authentification dialog where he can grant the permissions, once he has, he will be redirected to your app page on facebook (apps.facebook.com/myapp).

Where would I use this?

I am also using the following code, in my hook. Assuming that if come to my app and you are not logged in, it will automatically redirect you to the canvas page to “get app”, is that a correct assumption. Meaning the person that is in my app is logged in.

$CI->fb_me $CI->fb_ignited->fb_get_me(true); 

Also using, need to make this into a hook. I don’t want anyone to access my real domain, if they do it will redirect to the canvas page (apps.facebook.com/your-app-name)

<?php

$server_referer 
$_SERVER['HTTP_REFERER'];

if(
$server_referer === NULL || strpos($server_referer,'apps.facebook.com') === FALSE){
 header
('Location: https://apps.facebook.com/your-app-name/');
}
?> 
 
Posted: 17 August 2012 10:53 AM   [ Ignore ]   [ # 106 ]   [ Rating: 0 ]
Avatar
Joined: 2009-10-10
20 posts
sweetD - 17 August 2012 09:41 AM
Kimmik - 17 August 2012 03:08 AM

Check permission does that, here an example (goes into your controller)

$this->fb_ignited->fb_check_permissions('read_stream, friends_likes, user_photos'true); 

If the user hasn’t installed the app or hasn’t given the permissions he will be redirected to the app authentification dialog where he can grant the permissions, once he has, he will be redirected to your app page on facebook (apps.facebook.com/myapp).

Where would I use this?


In your controller if you need special permissions.

sweetD - 17 August 2012 09:41 AM

I am also using the following code, in my hook. Assuming that if come to my app and you are not logged in, it will automatically redirect you to the canvas page to “get app”, is that a correct assumption. Meaning the person that is in my app is logged in.

$CI->fb_me $CI->fb_ignited->fb_get_me(true); 

Jepp, if you use that the user will be redirected to the login dialog if he isn’t logged in.

sweetD - 17 August 2012 09:41 AM

Also using, need to make this into a hook. I don’t want anyone to access my real domain, if they do it will redirect to the canvas page (apps.facebook.com/your-app-name)

<?php

$server_referer 
$_SERVER['HTTP_REFERER'];

if(
$server_referer === NULL || strpos($server_referer,'apps.facebook.com') === FALSE){
 header
('Location: https://apps.facebook.com/your-app-name/');
}
?> 

I don’t know how that works or why you would need that, your app always runs in an iframe anyway.

 
Posted: 17 August 2012 11:01 AM   [ Ignore ]   [ # 107 ]   [ Rating: 0 ]
Joined: 2012-05-02
29 posts

So this just dosen’t have to do when they sign up / login or “getapp” this can be at any point. How do I get the results of this?

$this->fb_ignited->fb_check_permissions('read_stream, friends_likes, user_photos'true); 

Also the last code I shared, has to do with if anyone views the source and see a link in my app that goes to http://www.my-original-app-location.com/controller/view and they go to it, I want it to redirect them back to the canvas page, because with out that code, if the user is logged in, it will take them to that website and not redirect them to the app. I’m trying to build a inside of facebook “native” app, or at least a simulated “native” app.

 

 
Posted: 17 August 2012 12:04 PM   [ Ignore ]   [ # 108 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-21
77 posts

Also you can add the additional auth to $config[‘fb_auth’]  = ‘’;

 Signature 

Dark Prospect Games, LLC | Facebook Ignited on GitHub

 
Posted: 17 August 2012 12:06 PM   [ Ignore ]   [ # 109 ]   [ Rating: 0 ]
Joined: 2012-05-02
29 posts
deth4uall - 17 August 2012 12:04 PM

Also you can add the additional auth to $config[‘fb_auth’]  = ‘’;

I am using that, but if i want to get user_groups how do I display the data, the object doesn’t seem to contain some of the extra requests.

 
Posted: 17 August 2012 12:13 PM   [ Ignore ]   [ # 110 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-21
77 posts

When you approved the app, did it add all those permissions to the authentication?

 Signature 

Dark Prospect Games, LLC | Facebook Ignited on GitHub

 
Posted: 17 August 2012 12:16 PM   [ Ignore ]   [ # 111 ]   [ Rating: 0 ]
Joined: 2012-05-02
29 posts

It did, I saw them on the right side of the screen, but when I print_r the $this->fb_me none of that additional stuff is added on, such as user_groups. I did notice birthday, email. Seems to be basic stuff.

 
Posted: 17 August 2012 12:28 PM   [ Ignore ]   [ # 112 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-21
77 posts

You need to specifically ask for the rest using the api() method.

 Signature 

Dark Prospect Games, LLC | Facebook Ignited on GitHub

 
Posted: 17 August 2012 10:42 PM   [ Ignore ]   [ # 113 ]   [ Rating: 0 ]
Joined: 2012-08-17
4 posts

Haiii….. great library…. im very curious to develop my project with this… smile
i just wanna to ask some basic question…

1. i cannot understand how the welcome page like button is not showing that such as “You like this” if i click like… is there some config missed or mistype ?
My config

$config['fb_appid''###';
$config['fb_secret''###';
$config['fb_canvas''juara_community';
$config['fb_apptype''iframe';
$config['fb_auth''email'

2. is it possible to show status of users who using myFbApps that i created ? i have read it that i need some kind a access token to make it works but on the facebook_ignited methods i never seem any access token to input to get user data array…..

3. if is there a access token to access user data, how to make it never expired…... (need a official school portal to show some school status in my portal…so since it official i should make the access token never expired)

4. is it possible to user to create some event on facebook by using this library ?

thanks for the library, your respond and sorry for my basic question….. i guess this would be a good reference for some beginner like me in advance smile

 

 Signature 

...thanks for the respond by the way smile

 
Posted: 18 August 2012 12:03 AM   [ Ignore ]   [ # 114 ]   [ Rating: 0 ]
Joined: 2012-05-02
29 posts

I can answer #1, when you load the site inside of facebook like button dosen’t appear if you go to the url of your canvas page http://yourAppDomain.com you’re likely to see the like button. I can’t tell you why, nor did any pop ups work for me while I was within the app.facebook.com/yourApp, but outside everything worked fine.

 
Posted: 18 August 2012 12:10 AM   [ Ignore ]   [ # 115 ]   [ Rating: 0 ]
Joined: 2012-08-17
4 posts

I can answer #1, when you load the site inside of facebook like button dosen’t appear if you go to the url of your canvas page http://yourAppDomain.com you’re likely to see the like button. I can’t tell you why, nor did any pop ups work for me while I was within the app.facebook.com/yourApp, but outside everything worked fine.

i use the demo page from fresh facebook_ignited welcome page,
the problem is when i click like… the button never change to “You like this apps” or something like that or any number of how many people like my apps ?

sorry i guess my #1 question does not very clear..

 

 Signature 

...thanks for the respond by the way smile

 
7 of 11
7