Facebook login error

0 favourites
  • 11 posts
From the Asset Store
7 Errors
$15 USD
7 Errors is a game where you have to find the 7 mistakes before time runs out. Can you find all 7? Have fun looking.
  • 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.

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

    thanks a lot,

    Ivan.

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

    mygame.com/game/index.html

  • 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.

  • Same problem here ,, Any one have a solution ?

  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

    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...

  • 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.

  • 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.

    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

  • unfortunately I do not have time to learn javascript but I'm willing to pay if you can help me, I need to resolve this problem, because for me is very important to run the game (and the facebook login) also on mobile.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)