Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

Facebook login error

  • Hi guys,
    I was looking for the facebook integration

    But i have an error

    “error”: {
    “message”: “Invalid redirect_uri: N\u00e3o \u00e9 poss\u00edvel carregar a URL”,
    “type”: “OAuthException”,
    “code”: 191,
    “fbtrace_id”: “B9Xhvdff”
    I chose the option website

    0_1468710850441_2016-07-16 (3).png

    0_1468710993004_2016-07-16 (2).png

    var app = angular.module('myApp', ['onsen.directives']);
    app.controller("ListCtrl", function(){
        this.num = friendsList.length;
        this.friends = friendsList;
    app.controller("HomeCtrl", ["$http", function($http){
        ConnectToFB = function(){
            var client_id = 'xxxxxxxx'; //YOUR App ID or API Key
                  var client_secret = 'xxxxxxxxxxx'; //// YOUR App Secret
            var redirect_uri = '';  //// YOUR CALLBACK URL
            var display = 'touch';
            var authorize_url = "";
            authorize_url += "client_id=" + client_id;
            authorize_url += "&redirect_uri=" + redirect_uri;
            authorize_url += "&display=" + display;
            authorize_url += "&scope=publish_stream,offline_access";
             var ref =, '_blank', 'location=yes');
            ref.addEventListener('loadstart', function(event)
                var loc = event.url;
                if(loc.indexOf(redirect_uri + "?") >= 0)
                    var result = loc.split("#")[0];
                    var accessToken = result.split("&")[0].split("=")[1];
                    var url = '';
                        url += 'client_id=' + client_id;
                        url += '&client_secret=' + client_secret;
                        url += '&code=' + accessToken;
                        url += '&redirect_uri=' + redirect_uri;
                        accessToken = data.split("&")[0].split("=")[1];
                        url = "" + accessToken;
                            this.friendsList =;

  • @Leonardo-Augusto said:


    Googling the error code shows this:

    In FB App you have to assign an IP Site/ App Domain.

    Facebook matches this url with the url of the request where it came from.
    You can not assign localhost or
    You have to enter the IP address your server. Also if it is rails then call the site with your-ip:3000 instead of localhost:3000; I use
    Enter the same IP address in IP of the site and APP Domain in your FB APP Settings.

    Edit: Maybe a better answer: