Hybrid Application URL and domain in Facebook App

I am using the below code and it works fine in browser. I am using my local IP address as the url and domain in the FB app settings and there are no issues.

Backendless.UserService.loginWithFacebookSdk({email:"email"},new Backendless.Async(fbOk, fbFail));

But, when I use in my hybrid Ionic app, the login does not work due to the below message in console.

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains

For a hybrid mobile, what URL shoudl be provided in the FB app settings? Is there any specific backendless oauth URL to be used?

When you login with Facebook SDK, the requirements for the URL are the same whether you use Backendless call or not. If you use your local IP address, it would be a problem since the Facebook servers cannot reach your local machine.

As mentioned on desktop it works as I use the same URL(192.168.1.102:8100) as served by Ionic. It works without any issues on desktop.

I have no clue what needs to be used for mobile. In the past with other OAUTH implementation, http://localhost/ would work but not with Backendless.

Could you show you facebook app configuration (have you specify backendless url there?).
http://support.backendless.com/t/facebook-url-blocked

Images of FB app attached. This works great in my desktop version of the app. The URL used is my local URL.

But I am not sure what needs to be provided when it comes to mobile hybrid app.

Have tried as per https://backendless.com/documentation/manage/mgmt_social_settings.htm too, but no luck.

Kindly acknowledge on the provided details and please share updates if any.

I assigned it to a developer to investigate further. Internal ticket ID is BKNDLSS-12302

Hi, Purusothaman Ramanujam

The error:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains

means that there is inconsistency in Facebook application settings. Although it is not the Backendless side, we can give it a look if you could send us your project (or a minimal Ionic project that reproduces this Facebook message). You can send it to support@backendless.com

As mentioned, the code works fine when tried from the browser, which confirms that the above is not the reason. The problem I assume is that the FB ping url does not have a url value populated when called from the ionic project in real device. If it has “localhost” and the same has been set in FB app setting, this should work.

Plz let me know if you still need the sample app to test.

Can you try it with public IP (not your local 192.168.1.102:8100)?

If you still encounter the error, please send us the sample app that reproduces it.

I am building the application as an hybrid mobile app which does NOT have any public IP. As mentioned already, any public url usage works fine, but not in a cordova based hybird app.

Have you tried addressing it with Facebook? It appears to me the problem is on their side of things…

Absolutely not the issue with FB. I have used other OAuth services and they all work fine in Cordova apps.

Even with Backendless, it works fine in a web browser. Problem is only with an Ccordova app.

I will share some dummy Ionic app for your team to test it out.

Thanks. Having access to a sample demonstrating the problem would help us solve it faster.

I have shared one of my draft app source code for testing social login.

Please let me know if there is any progress on this issue. I am eager to test it :slight_smile:

Hi,
we tried to run your project on android device and got this endless spinning loader.

Any ideas/recommends to run it properly?

Stanislav

Any fix for this ? I am also facing the same issue.