Support Topics Documentation Slack YouTube Blog

The domain of this URL isn't included in the app's domCan't Load URL:ains. To be able to load this

I was try to integrate facebook with backendless, and need to get friend list in AngularJs.

While registering web application with facebook using backendless I have given
App Domains : app.backendless.com
Site URL : https://api.backendless.com .It was giving correct response for login ,then if we make an api call to get friend list using javascript sdk it was giving error( The domain of this URL isn’t included in the app’s domCan’t Load URL:ains. To be able to load this).Later I have changed (I was running my application on localhost)

App Domains : localhost
Site URL : http://localhost:8080/Instagram-poc/ .

Now if the user is logged in already the api calls were working, if user not logged in yet then again I got same error( The domain of this URL isn’t included in the app’s domCan’t Load URL:ains. To be able to load this).
This is my code

           function callback(user){ 
			console.log(angular.toJson(user));
		 }
		 function gotError( err ){
			 // see more on error handling 
			 console.log( "error message - " + err.message );
			 console.log( "error code - " + err.statusCode );
		 } 



          $scope.login = function(){
	               	facebookFieldsMapping = {email:"email"};
		        permissions = "email"; 
		        Backendless.UserService.loginWithFacebook(facebookFieldsMapping, permissions, new                                                  Backendless.Async(callback, gotError));
	                	FB.init({
 		                 appId      : '240390603000275',
 		                 xfbml      : true,               
 		                version    : 'v2.6'
 		                 })
		
		 FB.getLoginStatus(function(response) {
  			  if (response.status === 'connected') {
  			    FB.api('/me/friends', function(response) {
                              $scope.$apply(function() {
                                  $scope.myFriends = response.data;
                                  console.log($scope.myFriends);
                               });
                         });
  			  }  else {
  				  FB.login();
  			  }
  			});
	     }

Please, can anybody give me the solution

    There is no such thing as "app.backendless.com". Perhaps you meant "api.backendless.com" I believe using "localhost" is not allowed. Facebook knows nothing about site located at "localhost", they have to redirect request to that "Site" and would not be able to.

Thank you for your reply. But I am not able to solve this problem.
My requirement is

  1. Integrate facebook with backendless.
  2. Get facebook friendlist using angularjs.

1.If I give Redirect_uri as “https://api.backendless.com”. For login it was working fine, then if make an api call to facebook to get friendlist I was getting
{“error”:{“message”:“An active access token must be used to query information about the current user.”,“type”:“OAuthException”,“code”:2500,“fbtrace_id”:“F91TX8IvPf+”}}

2.If I give Redirect_uri as “http://localhost:8080/Instagram-poc” then it won’t give facebook login dialog box. But If we make an api call to facebook it was working.

What should I do? can you give any solution for this…

I found a solution.I kept both url’s in redirect_uri. It is working now.
Thank you.