Software Archive
Read-only legacy content
17061 Discussions

Facebook Connect

Alexander_F_
Novice
10,165 Views

Something is happened now with my app, because when I try to login with fecebook I get the message that that the given url is  not allowed by the application and this works before, think that I have to add a web platform to my facebook app but what is the site url that I have to enter here or if is another solution let me know, I am getting this issue in Android and in IOS do not show the message but doesn't work too.

http://prntscr.com/8317ee

function facebook_login(){
    var fbLoginSuccess = function (userData) {
        //alert("UserInfo: " + JSON.stringify(userData));
        //get info
        facebookConnectPlugin.api("me/?fields=id,email,first_name,last_name,name,link,website,address", ["public_profile"],
            function (result) {
                fb_alias = result.name.toString().toLowerCase().replace(' ', '');
                //get user by alias
                $.ajax({
                    type: 'POST',
                    url: rest_url + 'mobile/get_user/' + '?callback=?',
                    data: {id:null, alias:fb_alias},
                    success: function(data){
                        data = $.parseJSON(data);
                        if(data.status == 'success'){ //exists
                            is_login = 'yes';
                            window.localStorage.setItem('biipit_is_login', is_login);
                            user = data.message[0];
                            window.localStorage.setItem('biipit_user', JSON.stringify(user));
                            window.localStorage.setItem('biipit_user_id', user.id);
                            if(user.account_type == 'B'){
                                $.mobile.changePage('#business_profile', {transition:'flip'});
                            }else{
                                $.mobile.changePage('#personal_profile', {transition:'flip'});
                            }
                        }else{ //new register
                            fb_email = result.email;
                            window.localStorage.setItem("biipit_reg_email", fb_email);
                            //create password
                            fb_password = 'biipit';
                            window.localStorage.setItem("biipit_reg_pass", fb_password);
                            //submit data
                            $.mobile.loading('show');
                            $.ajax({
                                type: 'POST',
                                url: rest_url + 'mobile/profile/' + '?callback=?',
                                data: {
                                    mode:'facebook',
                                    account_type:'P',
                                    alias:fb_alias, 
                                    alias:fb_alias, 
                                    email:fb_email, 
                                    password:fb_password,
                                    first_name:result.first_name,
                                    last_name:result.last_name,
                                    facebook_profile:result.link,
                                    personal_profile:result.id
                                },
                                success: success_profile,
                                error: error
                            });
                        }
                    },
                    error: error
                });
            },
            function (error) {
                //alert("Failed: " + error);
            }
        );
    };
    //check login status
    facebookConnectPlugin.getLoginStatus(
        function(result){
            if(result.status == 'connected'){
                fbLoginSuccess(result);
            }else{
                //login
                facebookConnectPlugin.login(["public_profile"],
                    fbLoginSuccess,
                    function (error) { 
                        alert("" + JSON.stringify(error)); 
                    }
                );
            }
        }, function(error){
                alert('Failed: ' + JSON.stringify(error));
        }
    );
}

 

1 Solution
John_H_Intel2
Employee
10,155 Views

I have attached screenshots of my XDK facebook settings, my developer.facebook.com settings, and my project itself. Hopefully you can see what you are doing incorrectly from them :)

Once built, it allows you to login with fb and post to your wall.

View solution in original post

0 Kudos
28 Replies
Amrita_C_Intel
Employee
8,396 Views

Hello,

are you testing on device or emulator?

Have you included  Facebook connect plugin?

I am unable to see your screenshot.

 

0 Kudos
Alexander_F_
Novice
8,396 Views

I am runing my app on Iphone and Android Device, yes the facebook plugin is included and the screen shot is only where the facebook developer website ask me about the site url... the question is Which platform I have to add in my facebook app and what is the site url?

0 Kudos
Alexander_F_
Novice
8,393 Views

Here is the screenshot in my Android Device, in Iphone do not show nothing, but doesn't work too.

0 Kudos
Alexander_F_
Novice
8,393 Views

Any update with this, thank you

0 Kudos
Amrita_C_Intel
Employee
8,393 Views

The problem is that whatever url you are currently hosting your app is not setup in your Application configuration. Go to your app settings and ensure the urls are matching.

Updated

Steps:

  1. Go to 'Basic' settings for your app
  2. Select 'Add Platform'
  3. Select 'Website'
  4. Put your website URL under 'Site URL'

OR

Try to check at Settings > Advanced. At Valid OAuth redirect URIs, make sure you have a correct domain or let it empty (not recommended)

 

This might help

http://stackoverflow.com/questions/14474122/given-url-is-not-permitted-by-the-application-configuration

0 Kudos
Alexander_F_
Novice
8,393 Views

Yes I understand that but what is the URL if I am running my app from a mobile device?

0 Kudos
Joshua_S_1
Beginner
8,388 Views

We are having the same problem in our app..

Suddenly our users can not login with facebook.  

In our app domains we have html5tools-software.intel.com but suddenly we are getting the same error.

Please help.  Majority of users login with Facebook

0 Kudos
Alexander_F_
Novice
8,388 Views

good to know that, then problem is not only mine, Amrita can you check please.

Thank You.

0 Kudos
Amrita_C_Intel
Employee
8,384 Views

Hello,

I tried with my sample app it is working. I have attached the zip file try to run that. Nut make sure you have facebook app installed in your device.

 

 

0 Kudos
Alexander_F_
Novice
8,384 Views

Can you post here the screenshot of your settings in Facebook App?

0 Kudos
Alexander_F_
Novice
8,384 Views

Please can you post here which site url you enter in Facebook Basic Settings App

Platform? and Site URL?

Thank You.

0 Kudos
Alexander_F_
Novice
8,384 Views

By the way this is the result testing with your app.

Facebook app opens, facebook login prompt shows. I enter login info for facebook. Facebook shows message: App not setup: This app is stil in development mode , and you don't have access to it. Switch to a registered test user or ask an app admin for permissions.

 

0 Kudos
Alexander_F_
Novice
8,381 Views

Hey I still have the problem and testing with your application doesn't work too... please by third time what is the URL to enter in Facebook Application Settings, I clicked on Add Platform and added a Web Platform but think that the problem is the site url, for example my website is in http://www.biipitdev.com and I enter this one but I get an error when try to use Facebook Connect Plugin.

 

0 Kudos
Amrita_C_Intel
Employee
8,381 Views

Hello Alexander,

First of all you need to replace the app id which you get from the facebook app.

And the Screenshots and further details are in this Article!

https://software.intel.com/en-us/xdk/article/facebook-connect-plugin-android-ios

Let me know if it doesn't work.

0 Kudos
Alexander_F_
Novice
8,375 Views

Of course that I have the app id provided for facebook http://prntscr.com/83uhzn

The problem is with the Site URL under Web Platform, and this information do not appear in the screenshots.

 

0 Kudos
Joshua_S_1
Beginner
8,373 Views

Amrita~

I think you are miss understanding the problem Alexander and I are having.  I think our code bases are fine.  I have not seen Alex's codebase but the code base my team is using is even in the app store and has been working fine for weeks.  It is compiled and has not been touched.

I think the problem is in the set up of the app on Facebook.  More specifically the app domain.  

Up until now we have always used html5tools-software.intel.com.  This has worked for my team for close to a year now.  

That said,

I downloaded and installed your "Simple" app.

The app installs and runs.

However when I click the login button I get the same exact error:

Given URL is not allowed by the Application configuration. One or more of the given URL's is not allowed by the app settings.  To use this URL you must add a valid native platform in your app's settings.

Please see screen shot below.

 

 

0 Kudos
John_H_Intel2
Employee
10,156 Views

I have attached screenshots of my XDK facebook settings, my developer.facebook.com settings, and my project itself. Hopefully you can see what you are doing incorrectly from them :)

Once built, it allows you to login with fb and post to your wall.

0 Kudos
Alexander_F_
Novice
8,369 Views

Exactly that what I am talking from the begin look that in your Facebook App Settings you have IOS Platform and not Web Platform Added, let me try with this one and I let you know... 

Thank You.

0 Kudos
Alexander_F_
Novice
8,366 Views

Nothing still getting the same error :(, tested on Android Device, now can not test on IOS device because the OTA Install link is disabled again and can not install the update on my Iphone.

0 Kudos
John_H_Intel2
Employee
7,283 Views

You are reporting 2 different issues. Building for Android does not disable the iOS OTA link from working. 

So you need help, aka, screenshots of the android build settings for Facebook as well is basically what I am hearing?

0 Kudos
Reply