Facebook login error

Discussion and feedback on Construct 2

Post » Wed Jan 29, 2014 8:27 am

Hi,

I've read a thousand times all posts to login with facebook but I have not found an answer to solve the problem , I think that many people want to run the facebook login on mobile.

I have created 2 applications in the developer page of facebook, one pointing to my local test environment and one to my website with https installed.

When I try the login in my test environment , the game works and it is able to log to facebook, this is also clear to me , because I have tested the game on my private network and in the facebook application I have defined my private network as domain.

But if I use the "online" facebook application with my https site the login NOT works, I think this is also clear: the mobile device does not belong to the domain of my site.

Now the questions:
all the mobiles with my game installed, don't belong to my domain, how can Facebook understand that is a "trust" game?

should I change a parameter in the developer facebook page?: if I put "for android " ask me "Package Name" or "Key Hashes " or " Class Name" , but where do I find these values?

or I should put "App on Facebook " ? but what values ??of "CanvasURL" ?

I sincerely tried all the possibilities but it still not works !


Thank you for an answer!!!!!!

Best Regards,
Ivan Zanirato.
B
6
S
2
Posts: 18
Reputation: 1,111

Post » Fri Jan 31, 2014 11:48 am

please can someone help me? can anyone tell me where I'm wrong?

thanks a lot,
Ivan.
B
6
S
2
Posts: 18
Reputation: 1,111

Post » Fri Jan 31, 2014 11:56 am

In the facebook settings, for your https adres, try adding ?s=1   behind it. (or whatever parameter with val )


https://mygame.com/game/index.html?s=1




Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sat Feb 01, 2014 7:45 pm

Hi Lennaert,

thanks for the reply, I tried with the parameter "?s=1", but I always get the error:
An error occurred. Please try again later.

API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.


How did you configure the fb in developer page? Can you post please a screenshot?

This problem is driving me crazy ......

Thanks and best Regards,
Ivan.
B
6
S
2
Posts: 18
Reputation: 1,111

Post » Tue Feb 11, 2014 4:38 pm

Same problem here ,, Any one have a solution ?
B
17
S
3
G
3
Posts: 86
Reputation: 2,795

Post » Tue Feb 11, 2014 11:05 pm

EDIT: for the canvas url insert the index.html with "?" like index.html?, mine works with /index.php?

and someone will find it useful for this problem:

when you open your index.html, you need the permission of the user to use some information of the user... in other way, facebook need to know what will do your app with the user information...

when you make a facebook app, you need to edit your index.html with some code of php.

Save your index.html in index.php, and add this code before the "<!DOCTYPE html>"

-------------------------

<?php
session_start();
require 'client/facebook.php'; ///API OF FACEBOOK
$app_id = "***************"; ///INSERT YOUR...
$secret = "****************"; ///INSERT YOUR...
$app_url = "URL OF YOUR APP"; ///INSERT YOUR...
// Create our Application instance
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $secret,
));
// Get User ID
$user = $facebook->getUser();
//Do we have a user?
if(!$user) {
$loginUrl = $facebook->getLoginUrl(array('scope'=> 'offline_access', 'read_insights', 'publish_stream', 'user_about_me', 'user_likes', 'email','redirect_uri'=> $app_url));
     
     echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
    } else {
          try{
              //Proced knowing you have a logged in user who's autenticated
              $user_profile = $facebook->api('/me');
              $name = $user_profile['name'];
              $id = $user_profile['id'];
              $first_name = $user_profile['first_name'];
              $last_name = $user_profile['last_name'];
              $link = $user_profile['link'];
              $username = $user_profile['username'];
              $gender = $user_profile['gender'];
              $locale = $user_profile['locale'];
              $email = $user_profile['email'];
              
              
          } catch (FacebookApiException $e) {
              echo ($e);
              $user = null;
          }
}
?>
-----------------------

you don't need all of this code in your case, but if you insert this maybe will work... I achieved this when I need to save the information in my database with the php... with this, you don't need the plugin of facebook, because you can get some data from the AJAX.

let me know if you resolve the problem, now I not have so much time to reply and I don't speak english very well


Ribis2014-02-11 23:15:22
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Wed Feb 12, 2014 7:34 am

Thanks for the reply, but I am able to run the facebook login on my website (aspx page with ajax), my problem is to run the facebook login on mobile/phone, for example on Android after creating the app with crosswalk (https://www.scirra.com/tutorials/809/how-to-export-to-android-with-crosswalk).

I also created a job to request the intervention of someone (http://www.scirra.com/forum/facebook-login_topic85195.html)

Thanks a lot and best Regards.
B
6
S
2
Posts: 18
Reputation: 1,111

Post » Wed Feb 12, 2014 9:07 am

[QUOTE=Ivan] Thanks for the reply, but I am able to run the facebook login on my website (aspx page with ajax), my problem is to run the facebook login on mobile/phone, for example on Android after creating the app with crosswalk (https://www.scirra.com/tutorials/809/how-to-export-to-android-with-crosswalk).

I also created a job to request the intervention of someone (http://www.scirra.com/forum/facebook-login_topic85195.html)

Thanks a lot and best Regards.
[/QUOTE]

I never try to export for android or iOS with the plugin of facebook... but I think the plugin of facebook doesn't working with the mobile, but I'm not sure about that...

The app need to communicate with the app of facebook maybe (different way from the computer)

maybe, you can insert to the final app some script to intagrate facebook...

when the XDK export the app, you can open the app and edit or insert a new script? and maybe you need to use GET remote data in construct2...
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Wed Feb 12, 2014 9:31 am

Hi Ribis,

thanks, I also think that the C2 facebook plugin does not work with Android, it need a lot of programming and I do not have the ability to program a script and unfortunately there are not any tutorial step by step.
B
6
S
2
Posts: 18
Reputation: 1,111

Post » Wed Feb 12, 2014 9:45 am

[QUOTE=Ivan] Hi Ribis,

thanks, I also think that the C2 facebook plugin does not work with Android, it need a lot of programming and I do not have the ability to program a script and unfortunately there are not any tutorial step by step.[/QUOTE]

For this reason I suggest to study javascript and start with easy tutorial on the web... but maybe construct2 will support this in future...

for me is very important to have a social connection with facebook or something
B
21
S
9
Posts: 298
Reputation: 2,967

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 17 guests