After login success it’s should be redirect to the app.
i am using the both enviroment localy (ionic and backendless).
here is the code that do login with facebook
function fbLogin() {
Backendless.UserService.loginWithFacebook(null, null, new Backendless.Async( successCallback, errorCallback ), null);
};
how i can solve this.
Hi, I have same problem… use Ionic with backendless me too . When i test my app inside browser i haven’t problem but if i use it on device registration work but return white page with this error “Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘file://’) does not match the recipient window’s origin (‘https://api.backendless.com’).”
the problem is not only facebook but for all social login… I noticed that when i execute Backendless.UserService.loginWithFacebook in browser start another page for login where request data for access and after registration it’s automatically close… Instead on device this page doesn’t close and remains blank with that mistake
i tried both, loginWithFacebook() and loginWithFacebookSDK() methods and not working.
but loginWithFacebookSDK() method give me this response:
URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.
To get the javascript method for social login using Backendless Javascript SDK 3.1.23 to work with Backendless Standalone version 3.X you need to make the following changes. If you are using local file system then will need to change below to support.
Change SDK method _loginSocialin in the backendless.js file - the standalone Backendless.serverURL end with /api but e.origin is only the hostname, so if (e.origin == Backendless.serverURL) will never be true.
From
_loginSocial: function(socialType, fieldsMapping, permissions,
async, container, stayLoggedIn) {
.
.
Utils.addEvent('message', window, function(e) {
if (e.origin == Backendless.serverURL) {
var result = JSON.parse(e.data);
To
_loginSocial: function(socialType, fieldsMapping, permissions,
async, container, stayLoggedIn) {
.
.
Utils.addEvent('message', window, function(e) {
var pathArray = Backendless.serverURL.split("/");
var protocol = pathArray[0];
var host = pathArray[2];
var url = protocol + '//' + host;
if (e.origin == url) {
var result = JSON.parse(e.data);