Cordova/PhoneGap Facebook Integration without Plugin

04/08/2014 update: pushed version 0.2 with a couple of bug fixes.

Many consumer apps provide a Facebook Login option, as well as other Facebook integration features such as posting to your feed, getting your list of friends, etc.

Cordova has a Facebook Plugin that makes that integration easy. Internally, the plugin uses both the Native and the JavaScript implementations of the Facebook SDK, and historically, it has sometimes been hard for the plugin to keep up with new versions of these SDKs, as well as new versions of Cordova.

In a recent Cordova project, I integrated with Facebook without using the Facebook Plugin, and in fact without using the Facebook SDK at all. I implemented a traditional OAuth workflow to log in (as described here), and made direct HTTP requests to Graph API endpoints to retrieve and post data.

I encapsulated that logic in a micro library that I called OpenFB, and decided to share it in this article. Here are a few code examples…

Login using Facebook:

openFB.login(scope, successHandler, errorHandler);

Get the user’s list of friends:

openFB.api({path: '/me/friends', success: successHandler, error: errorHandler});

Post on the user’s feed:

        method: 'POST',
        path: '/me/feed',
        params: {
            message: 'Testing the Facebook Graph API'
        success: successHandler,
        error: errorHandler

The approach used in OpenFB (plain OAuth + direct requests to Graph API endpoints) is simple and lightweight, but it is definitely not perfect.


  • No plugin dependency and no uncertainties when new versions of Cordova or the Facebook SDK are released.
  • Works for all platforms, including platforms for which a version of the plugin doesn’t exist.
  • Works for both browser-based apps and Cordova apps.


  • Not full-fledged, less out-of-the box features.
  • Integration not as tight. For example, no native dialogs, etc.

Browser and Cordova Apps

The library works for both browser-based apps and Cordova/PhoneGap apps. When running in a browser, the OAuth URL redirection workflow happens in a popup window. When running in Cordova, it happens inside an “In-App Browser”.

Try it here

You can try the sample app here (My sample Facebook app is called Sociogram). This application is intentionally simplistic to keep the code readable and focused on the Facebook integration. The same app works inside Cordova.


Source Code

OpenFB is available in this repository on GitHub.

Getting Started

To run the sample on your own system:

  1. Create a Facebook app here: In the advanced settings, make sure you declare a “Valid OAuth redirect URI”. For example, if during development you access your application from http://localhost/openfb/index.html, you must declare http://localhost/openfb/oauthcallback.html as a valid redirect URI. Also add as a Valid OAuth redirect URI for access from Cordova.
  2. Copy the Facebook App Id and paste it as the first argument of the openFB.init() method invocation in index.html.
  3. Load index.html, from a location that matches the redirect URI you defined above. For example: http://localhost/openfb/index.html


No rocket science here. The Facebook Plugin is still the best technical solution because it provides a tighter integration with Facebook (using native dialogs, etc). However, if you are looking for a lightweight and easy-to-set-up solution with no dependencies, or if you are targeting mobile platforms for which an implementation of the plugin is not available, you may find this library useful as well. I’d love to hear your feedback, and learn how you are integrating with Facebook.

230 Responses to Cordova/PhoneGap Facebook Integration without Plugin

  1. Anonymous April 8, 2014 at 8:25 am #

    Great stuff Christophe, I was just looking for this exact solution.
    However I can’t seem to get this working for my Cordova app, the login works, then I see facebook redirecting to a facebook URL with an access token in the URI, but the window doesn´t close and the callback on openFB.login is never invoked (neither the success or error callback).
    When I isolate the code from my cordova project and run it in my browser it works fine… what am I missing / doing wrong? Thanks in advance!

    • Christophe Coenraets April 8, 2014 at 11:43 am #

      For Cordova you have to add <script src=’cordova.js’></script> in index.html. I checked in a new version of index.html where it’s there by default. I also just checked in a fix for Cordova detection when running in the emulator.

      Also make sure you add the inappbrowser core plugin:
      cordova plugins add org.apache.cordova.inappbrowser

      Let me know if this works for you.


      • Anonymous April 10, 2014 at 5:59 am #

        Thanks Christophe, I was missing the inappbrowser plugin (perhaps you can update the readme in your git repo to include this instruction).
        Works on my mobile device now, next step is to get it running in a ripple emulator, any thoughts on that? ;) Would it be possible at all?

        • Anonymous April 15, 2014 at 6:18 am #

          Would love to see how you got it working on mobile. Even after adding the plugin, the login window doesnt seem to go away. Seems like I have tried everything.

      • Sam May 22, 2014 at 9:25 am #

        openFB is working fine in my browser but in mobile app its showing me this message –
        SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.
        Give me a proper solution.

        Thanks in advance

        • Andy May 29, 2014 at 12:25 pm #

          Hi Christophe,
          Thank you so much for your library! But I’m also experiencing that issue. I just got stuck on that “success security warning” page and can’t get back to my app from it.
          We would really appreciate your help on this problem.

          • Andy May 30, 2014 at 9:04 am #

            I made it work finally.
            After digging around I found out that I was missing this line in config.xml file:

            (don’t forget to add xmlns:gap=”″ namespace as well)

            Hope this will help someone too.

          • Andy June 1, 2014 at 7:58 am #

            Oh, I just noticed that this line has been stripped out from my comment, so I’ll paste it without opening and closing brackets:

            gap:plugin name=”org.apache.cordova.inappbrowser”

            (it must be a self-closing XML tag)

        • Miguel September 7, 2014 at 8:09 pm #

          I have the same problem, any ideas?
          thank you

        • Miguel September 7, 2014 at 8:10 pm #

          I have the same problem:

          “SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.”

          any ideas?
          thank you

          • Miguel September 8, 2014 at 7:24 am #

            install cordova plugin org.apache.cordova.inappbrowser.
            In cordova 3.5:
            cordova plugin add org.apache.cordova.inappbrowser

            And facebbok, , app, avanced, Valid OAuth redirect URIs:

            And openfb.js: oauthRedirectURL = ‘’,


      • priyanka May 22, 2014 at 9:39 am #

        i am also facing same problem cordova app is working properly in browser but not in mobile app it showing me a success security message….would you please help us


        • Skyview June 3, 2014 at 10:12 am #

          Hi piyanka,
          I have the same problem, did you found a solution yet?

      • A.S.Karthick October 16, 2014 at 1:23 am #

        hi,I used this openFB for my ios app.It works well for the first time login my application via facebook login.when i logout my app then i tried to login my app via facebook, it did not worked. First time, the variable runningInCordova is true when i logout my app that variable runningInCordova is false. How can i fixed that please help me……..

        • Adrian June 30, 2015 at 5:48 pm #

          Try this: !/^(http(s)?:\/\/)/g.test(window.document.URL); to detect environment.

    • Nitin August 19, 2014 at 3:34 am #


      i am develop one application. that application using facebook with login using your tutorial.

      but application redirect callback url http://localhost:8888/menooz/asset/www/addmenu.html

      that was error application can`t connect to server.

      plz help us. thanks

  2. Solidux April 9, 2014 at 7:22 pm #

    Thanks for sharing.
    I have a question, you can share images with your method?

    • sondes January 26, 2015 at 9:30 am #

      Hello I’m developping a cordova application on which I have to share links with photo on facebook, is it possible to share image and url using this share button?

  3. Doron April 11, 2014 at 4:25 am #

    I’m trying to implement this with my ionic cordova app.
    I want to do it a little differently because i need to “login” button to be in an inner state rather in the main state.
    Any way i get the “login” to connect, but the oauth window does not close and i get this error:
    TypeError: injector is undefined
    injector.invoke(function (OpenFB) {

    and the access token is not saved anywere so i cannot access the graph api.
    any chance you can help?

  4. Kelvin Jones April 14, 2014 at 4:58 pm #

    When trying to run this in ios device i get error when click login to facebook

    OpenFB login failed

    any ideas?

  5. Simon Shahriveri April 16, 2014 at 5:02 am #

    Is there any particular reason why i am unable to post to facebook. I am able to login and retrieve info (i.e. Name) but if i add a message and try to share. i receive the error:

    (#200) The user hasn't authorized the application to perform this action

    Have you come across this before?

    Thanks for sharing btw :)

    • Jonnas Fonini April 16, 2014 at 12:15 pm #

      Change “openFB.login(’email’,” to “openFB.login(’email,publish_actions’,”.
      You can add additional permissions if you want.

      • Thamizharasan June 27, 2014 at 6:05 am #

        Hi Jonnas, I used publish_actions but it’s the permission is asked only for public profile. what should i do..?

    • zua July 16, 2014 at 11:10 pm #

      Hi Simon,

      try change your permission to this

      }, {scope: ‘read_stream,email,publish_actions,publish_stream’});

      delete this app from Facebook first and test again.

  6. Deric April 18, 2014 at 3:40 am #

    Great job Christophe. However, I have some doubts, the access token retrieved from the oauth method that you used, is it a short-term access token or a long-term access token?

  7. Praful April 19, 2014 at 11:25 am #

    I am getting blank facebook page as my redirect url is like “file:///”.
    whats the issue?

    • zua July 16, 2014 at 10:28 pm #

      Hi Praful,

      Open “openfb.js” and change baseURL to link where you place oauthcallback.html and logoutcallback.html.

      example: baseURL = ‘’,
      oauthRedirectURL = baseURL+’oauthcallback.html’,
      logoutRedirectURL = baseURL+’logoutcallback.html’,

  8. Vipul April 21, 2014 at 9:30 am #

    Nice stuff. (Y). Could you please provide the code to get feeds from profile ?

  9. Henry April 22, 2014 at 2:32 am #

    Hi Chris. This is suer helpful and way easier to use than the phonegap Facebook plugin. I was wondering how would I go about getting the permission to get more data from the users? I tried adding it in openfb.js under scope but that didn’t work. I also tried openFB.login(“email, id, gender”) but that didn’t work either. Thanks!

  10. Sasha April 22, 2014 at 5:59 am #

    Hello, i’m having a problem with facebook configuration because when i try to login my user the page says: “The given url is not allowed by the application configuration…”
    Its about 5 days that i try to make it work any help would be appriciated.

  11. sayang April 24, 2014 at 12:12 am #

    emm i wonder could you come out with tutorial facebook with plugin….having a lot problem using phonegap 3.4 with facebook plugin….other resources over the internet almost rubbish….

  12. Sasha April 24, 2014 at 11:17 am #

    After almost 3 days i can say that this worked for me, thank you very much for sharing.

    • Brandon April 29, 2014 at 8:35 pm #

      Sasha what did you do? We are having the same issues? Given URL not allowed by configuration.

    • nawaz June 20, 2014 at 7:36 am #

      Hi Sasha, would u please tell what did u do for that.. i’m confused that what will be the canvas url if app is on device.. My inappbrowser working fine. i’m getting the above error. would u please explain? Thanks in advance :)

      • Nawaz June 23, 2014 at 3:35 am #

        Hi Guys now it is working for me.. i m doing a phonegap app for windows phone 8 . So for fb login i’m using openFb. I’ve seen questions above that people are facing problems using this then people posting that it worked but no one posted how they do. I’ve faced the same problem now i got the solution. These are the steps i followed when i run the cordova “app” on windows phone 8.

        First u need to install inapp browser plugin on root folder.

        1. I’ve added openfb.js in my js folder
        2. on loading i called openFB.init(“app_id_from_facebook_app_page”);
        3. on button click i called openFb.login();

        Fb app Settings :

        1. in basic tab :
        canvasURL : http://localhost/www/ //(it has worked in device)
        secureCanvasURL : https://localhost/www/

        2. No need to give app domains . it will take defaults
        3. Dont give valid OAUTH redirect URIs in advanced tab. keep it blank
        4. don’t change anything in openFB.js

        That’s it
        Now the inapp browser opens with fb login page.

        Happy Coding :)

        Thanks :)

  13. Alfredo April 24, 2014 at 11:54 am #

    Hello Christophe,

    Implemented this in a Cordova/Phonegap App but All I get is the same as the first comment in this article. App goes to the login dialog, logs in then just a blank screen with the little blue button of the inappbrowser view. No callbacks fired.

    Browser version does nothing. FB settings appear to be ok. I’m testing using PhoneGap Developer App on iOS.

    Your help will be appreciated.

  14. Thibka April 29, 2014 at 1:46 pm #


    Thanks for your solution, it looks great. However, even though the login() method returns a success message, I can’t get the getInfo() method to work.
    Regardless if I try with your example app or with mine, the getInfo() method returns the following error :
    “Invalid OAuth access token”
    I have to admit I’m not quite comfortable with the facebook API, but I can’t figure out what I’m doing wrong… Do you have any idea ?
    Thanks a lot for you help,


    • Thibka April 29, 2014 at 4:12 pm #

      My bad, I just figured out what was wrong : I didn’t understand that I had to login() first to have access to the getInfo() method.
      Also, you should specify in your doc that the cordova.inappbrowser must be installed, as I only realized that after reading the comments.
      Anyway, thanks a LOT for your solution. :)

    • Christophe Coenraets May 11, 2014 at 3:45 pm #

      I pushed a fix for a bug where the login window was not closing when the token was received too fast: In that case, the inappbrowser was still opening (with an animation), which caused an exception when trying to close it. Should be fixed now. Let me know if it doesn’t work for you.

  15. Chanti April 29, 2014 at 4:30 pm #


    I able to run this is Browser.

    I am facing problem while running in Device.
    What should be the OAuth Redirect URL that need to be set in Facebook Application.
    I tried adding localhost/oauthcallback.html but it cant be located as it is running in device.

    • Brandon April 29, 2014 at 8:34 pm #

      Same problem

    • Chanti April 29, 2014 at 11:21 pm #

      Got it! We need to add inappbrowser plugin to the cordova project.

      • Brandon May 1, 2014 at 12:23 pm #

        Thanks Chanti….I did that as someone else mentioned that. But how did this affect your FB Settings. Meaning when I run localhost/openfb/www/index.html it works from my local dev box and my FB settings show localhost/openfb/www/oauthcallback.html. However when running in emulator or device it does not work.

        • Christophe Coenraets May 11, 2014 at 4:01 pm #

          When running in Cordova, the default OAuth redirect URI is: So make sure you add that in your app configuration on Facebook (Settings > Advanced > Valid OAuth redirect URIs).

          When running in the browser, the default oauthcallcack url is now: origin (protocol://server:port) + /oauthcallback.html’. So if you run your app from http://localhost:3000, make sure you add http://localhost:3000/oauthcallback.html as a Valid OAuth redirect URI in you Facebook App config (Settings > Advanced > Valid OAuth redirect URIs) and that the oauthcallback.html is indeed reachable at that location.

          if you run your app from http://myserver, make sure you add http://myserver/oauthcallback.html as a Valid OAuth redirect URI in you Facebook App config (Settings > Advanced > Valid OAuth redirect URIs) and that the oauthcallback.html is indeed reachable at that location.

      • Pratyancha June 4, 2014 at 3:06 am #

        Where we have to add that inappbrowser plugin???

        • Dwy Saputro October 29, 2014 at 3:11 pm #

          so, what the default canvas URL for phonegap-app should i register in facebook?
          thank you

      • nawaz June 20, 2014 at 8:06 am #

        Hi Chanti, would u please explain the settings in facebook app page.. I’m facing the same issue. that there’ll be localhost in device right? so what will be the canvas url.. In my case my app returning when i call window.location, is “x-wmapp0:www/index.html”. So for this what will be the canvas url and what will be the path for oauthcallback.html?

        Thanks in advance :)

  16. Icaro April 29, 2014 at 5:50 pm #

    Is Therer no way to open a dialogue within the phonegap with facebook login screen?

  17. Abd May 3, 2014 at 4:50 pm #

    Thanks for your amazing work It really helped me a lot.
    I have a question, by using this method what type of platform I should add to my Facebook app in the Settings section? do I need to generate hash for Android by using this method also?
    Any help will be appreciated.

  18. Chanti May 5, 2014 at 1:30 pm #


    It is clear that facebook token we get when we run from browser is Short live token.

    What kind of access token that I get if I run from real mobile device?

    One thing that is surprising me is, my app received an access token which is being used since 4 days and working fine.

    Any idea?

    • Akash May 6, 2014 at 11:17 pm #

      Hi Chanti,

      Similar to Brandon, would you know the URI you used to make this work? I tried localhost/assets/www/oauthcallback.html and a few others, none working. Shows a blank screen on the Android.

      • Tolotra May 12, 2014 at 9:10 am #

        In device it doesn’t work because ‘readydevice isn’t fired’, the solution is to add in your index.html. Don’t change anything in openFb.js and just call the openFb.init(‘YOUR_APP_ID’) with no other parameters. After 2 days of coffee i was able to get it work.

        @Christophe Nice job!

        • Tolotra May 12, 2014 at 9:15 am #

          oups seems like it doesn’t my call script, as i said you should include cordova.js script in your index.

  19. Soroush May 8, 2014 at 11:04 pm #

    How does this work for Cordova apps? the callbacksuccess for login will never be fired since the users get stuck in success page.

    • Christophe Coenraets May 11, 2014 at 4:05 pm #

      See my answers above. Make sure you download the latest version and that your Valid OAuth redirect URIs are configured.

      • Heber May 19, 2014 at 6:02 pm #

        I am using version 0.3 in Android and the method openFB.init still doesn’t redirect my URI.
        My URI is “file:///android_asset/www/index.html” Thanks.

    • Brandon Hines June 16, 2014 at 11:17 am #


      Did you look at my github for the Sociogram app?

  20. WilsonLeal May 13, 2014 at 6:56 pm #

    Very good!!
    Thanks a lot.

  21. Vaibhav Narula May 15, 2014 at 2:17 pm #

    Hi Chris,

    Amazing Post as usual.

    There is one question . How can we pull other data about the user using your library.?

    • vaibhav June 10, 2014 at 5:19 am #

      hey, did u got any solution to fetch other data from facebook….i require email id, profile pic and friend list.


  22. Jayaprakash May 16, 2014 at 12:11 am #


    This script was amazing and works perfect. But one thing is users can’t logout completely from facebook.

    • Shadi May 18, 2014 at 3:36 pm #

      did you find a solution for this issue, I face the same???

  23. Abd May 17, 2014 at 7:39 am #

    do I need to generate hash for Android to submit the facebook app even if i’m using this method also?
    if yes can you help me how to generate this hash?

  24. Amy Richards May 20, 2014 at 12:58 am #

    This is a vital topic ‘Cordova/PhoneGap Facebook Integration without Plugin | Christophe Coenraets’. Diamonds and Facebook Login option give us a blinding glimpse of the innovations that are coming our way—and that they are helping to create.

  25. May 20, 2014 at 4:42 pm #

    One who can remember the sills and one who is an expert, or at least your
    thoughts can certainly stimulate anxiety, and your ability to sleep and function well.
    Another aspect of counseling, and school psychologists.

    Of course, therre is often a complaint of individuals seeking counselling.
    If one has ever google quest looked into a pair of shoes can be seen on Thursday.

  26. Shrikant Havale May 24, 2014 at 1:08 pm #

    Excellent solution, for integrating facebook into applications. Only concern is about logout, doesn’t completely logout from application, I read several threads on stackoverflow about deleting cookies, clearing sessions, using facebook, logout.php , but no luck yet. Did anybody got solution for implementing logout

    • Mustafa September 15, 2014 at 2:52 am #

      Same issue here!

    • A.S.Karthick October 16, 2014 at 1:44 am #


      Did you try this code, its working for me…..

      function logout(callback) {
      var logoutWindow,
      token = tokenStore[‘fbtoken’];
      if (token) {
      logoutRedirectURL=”******your domain url**********”;
      var url=FB_LOGOUT_URL + ‘?access_token=’ + token + ‘&next=’ + logoutRedirectURL;

      type : ‘POST’, url : url,
      success : function(responseText){

      },error: function(e){
      setTimeout(function(){ },5000);
      console.log(” “+e);



    • Fernando November 17, 2014 at 6:05 pm #

      Add into loginWindowExit function in openfb.js the next sentences:

      loginWindow =‘’+tokenStore[‘fbtoken’], ‘_blank’, ‘location=no’, ‘clearcache=yes’, ‘clearsessioncache=yes’);

      You must to do a facebook logout on the same instance of the inappbrowser window, these lines should be close completily the facebook session. Sorry for my english, I speak spanish.

  27. Keylies May 25, 2014 at 12:42 pm #

    Hello Christophe,

    Very nice plugin. It works well with browser and on my mobile.

    I only got an error when I try to use it with local ripple :

    It’s the only way to test lastest cordova/phonegap lib on a browser, but I get a white screen with InappBrowser issue. It seems Ripple doesn’t support InappBrowser.

    If this variable : window.tinyHippos is true, it uses Ripple. But is there a way to bypass the error, I don’t see how…

  28. Rajesh May 28, 2014 at 3:20 am #

    It’s not running sir. while i am running the file on my emulator its loading only. nothing came sir. can you please help me.?

  29. Brad Griffith May 30, 2014 at 5:08 pm #

    Very nice work, Christophe. I’ve got it functioning perfectly in the browser, but I can’t get by the file:/// protocol problem in iOS or Android. The index.html file is loaded with file:/// instead of on http://localhost, and Facebook doesn’t allow file:/// protocol redirect URL’s. Have you gotten this working in the iOS emulator?


    • Ale July 2, 2014 at 10:28 am #

      same issue here.. any ideas?

    • Dirk Postma August 2, 2014 at 6:59 am #

      +1 What to do about this?

  30. Rahul Mandhani May 31, 2014 at 9:16 am #

    How to use this approach for phonegap android application… I try to implement it but stuck on what url to provide in apps settings

    Can any one help??

  31. Toni May 31, 2014 at 9:22 pm #

    Hi there,

    In my case fails,

    I am using phonegap 3.4 and the facebook login page is opened in a popup and as the callback uri is a file://authcallback.html then facebook wont print the login form, just a white screen. (If I, manually use the callback uri is setted in my app settings then it works )

    Any thoughts?


  32. Tejas June 2, 2014 at 8:40 am #


    How to use “Like Page” functionality from phonegap application using this openFB api’s.

    Any idea?


  33. Pratyancha June 4, 2014 at 3:17 am #

    When I press the login button on the android facebook page opens and after I login, the success page does not close. Getting ‘Success Warning Message’. Ahere we have to add that “inappbrowser plugin” ? In index.html file??? Please its urgent.

  34. Dave June 6, 2014 at 11:19 am #

    Great “plugin”. But what if we wanted to get the profile picture URL?


    I am doing this, but it doesn’t return any data.

    path: ‘/me/picture’,
    params: {
    redirect: ‘0’,
    height: ‘200’,
    width: ‘200’,
    type: ‘normal’
    success: function(data) {
    document.getElementById(“userName”).innerHTML = ”;
    error: errorHandler});

    Thannk you.

    • Ritij June 11, 2014 at 7:33 am #

      Yaa I m also Facing the dame problem…Can anyone provide the code to get the profile image through open fb librabry

      • Ritij June 11, 2014 at 7:43 am #

        its urgents..guys…any idea

        • Ale July 2, 2014 at 10:30 am #

          Profile picture is avaible on this url:

          • Ale July 2, 2014 at 10:31 am #

            you need to add user_id after .com/

    • Yogesh November 22, 2015 at 1:15 am #

      Did find a solution for this

  35. Mohini June 10, 2014 at 5:00 am #

    Hello all,
    Can anyone suggest me how can I set cookie TRUE in openFB.login function.?

  36. scibilo June 20, 2014 at 2:12 pm #

    great post!
    You can store the login/signup information in a mysql database?
    It’s necessary to send push notifications.

    Thanks in advance.


  37. Maragret Reinheimer June 21, 2014 at 2:16 am #

    Very nice blog post. I absolutely love this website. Keep it up!

  38. Kia June 25, 2014 at 8:59 pm #

    On va te dire que ce n’est guère absurde !

  39. Ezam June 25, 2014 at 11:10 pm #

    hello. i had a problem when use the users likes limit. when i put the limit to 100 then i got error message. ‘An active access token must be used to query information about the current user’ . So any solution regarding on this? please help me buddies.

  40. ernesto June 27, 2014 at 5:04 am #

    Hi, I’m trying to use it inside an appgyver project.
    Login seems to work and the FB windows is properly closed, but after the alert “Facebook login succeeded” in the login callback is fired the iOS simulator crashes.
    Any Idea?

    Thanks in advance

  41. Thamizharasan June 27, 2014 at 6:10 am #

    Hi Christophe Coenraets thanks for your great work.

    I’m having a issue to post photos in user feed. I cant get the extended permission (publish_actions) during login. What should i do to post the photo on user feed. Please kindly help me to resolve this issue…!

  42. Developer June 27, 2014 at 6:46 am #

    Very nice work. But while i tried your sample the share is not working. And also i cant get extended permissions through login. Please help me in solving this issue.

  43. Akash July 6, 2014 at 4:48 am #

    Hii when i change the app id and press the login button it just display me a blank screen. Please help

  44. Hitest July 7, 2014 at 8:45 am #

    Thanks Christophem, for this great solution.
    but i am getting message like “Given URL is not allowed by the application configuration…”

    did i do something wrong ?

    my file structure is as follow


    so oauthentication url should be like following ??

    Thank You :)

  45. Norwill July 7, 2014 at 4:26 pm #

    Great post,

    Only two questions.

    1. Is this compatible with the new version of facebook sdk (2.0) ?
    2. This open the facebook application if i have installed ?


  46. July 7, 2014 at 8:33 pm #

    Je vois immédiatement que vous maîtrisez superbement bien le sujet

  47. Katharina July 10, 2014 at 7:23 pm #

    What is the truth, and how Inhabitat editor Jill’s solar-powered
    backpack has been a big week in general for green transportation announcements, as
    several supercharged electric vehicles hit the streets will be a big challenge.
    Today, the top players in the auto industry of the world is the introduction of Asian car manufacturers in the engines of their latest models, while
    keeping the excellent quality of their car battery bracket engine performance.
    If youu are car battery bracket an grown up with a vehicle that
    has a price that justifies its mileage.

  48. jerseys Spurs July 12, 2014 at 9:53 pm #

    2014 new china cheap jerseys store, all jerseys for both man and woman, 100% quality guarantee, fast and free delivery.

  49. wholesale cheap Seahawks jerseys china July 12, 2014 at 10:29 pm #

    the Clippers jersey for mens kids and womens sale

  50. Markus Roth July 14, 2014 at 9:59 am #

    For everyone having trouble with the redirect_uri: If you are using this script within Cordova, the redirect URI should not be set. The script then uses as a redirect_uri, reads the value from that window and then closes the window automatically.

  51. wholesale Kings jerseys July 14, 2014 at 9:31 pm #

    Nets jerseys cheap Review China

  52. wholesale cheap Avalanche jerseys July 14, 2014 at 9:32 pm #

    Best Place To Buy wholesale jerseys Panthers cheap

  53. cheap Bills jerseys from china July 15, 2014 at 12:18 am #

    Buy wholesale Sabres cheap jerseys For Kids And Women

  54. kids Spurs jersey July 15, 2014 at 3:31 am #

    Shop for cheap authentic jerseys free shipping and get our ultra fast 7-day shipping standard and 365 day returns on any size order only at our cheap authentic jerseys free shipping online shop.

  55. zua July 16, 2014 at 5:02 am #

    Thanks very easy but share not working!

  56. sonu July 16, 2014 at 8:34 am #

    i am also facing same problem cordova app is working properly in browser but not in mobile app it showing white screen when click login. i am also set in aout .would you please help us

    • zua July 16, 2014 at 10:32 pm #

      Hi Sonu,

      Try this

      Open “openfb.js” and change baseURL to link where you place oauthcallback.html and logoutcallback.html.

      example: baseURL = ‘’,
      oauthRedirectURL = baseURL+’oauthcallback.html’,
      logoutRedirectURL = baseURL+’logoutcallback.html’,

      • sonu July 17, 2014 at 12:49 am #

        this is my openfb.js code

        baseURL = location.protocol + ‘//’ + location.hostname + (location.port ? ‘:’ + location.port : ”) + context,

        oauthRedirectURL = baseURL + ‘/www/oauthcallback.html’,

        logoutRedirectURL = baseURL + ‘/www/logoutcallback.html’,
        this is showing in console
        “file:///android_asset/www/logoutcallback.html”, source: file:///android_asset/www/openfb.js (39)
        and problem is same.

        • zua July 17, 2014 at 11:05 pm #

          Change to that i provide above.
          baseURL = location.protocol + ‘//’ + location.hostname + (location.port ? ‘:’ + location.port : ”) + context,

          and direct change to

          example: baseURL = ‘’, //where you place this 2 html file
          oauthRedirectURL = baseURL+’oauthcallback.html’,
          logoutRedirectURL = baseURL+’logoutcallback.html’,

        • zua July 17, 2014 at 11:10 pm #

          Facebook now need approval to get user feed and post to wall. So at we can send at “Status & Review” at the bottom have “Start a Submission” and I take few days for Facebook approval.

          For now only admin can share to wall. Other user cannot.

      • Mustafa September 15, 2014 at 3:09 am #

        It works fine for me, Thanks :)

  57. Xanax July 16, 2014 at 11:55 am #

    Attractive section of content. I just stumbled upon your weeb site and in accession apital to assert that I afquire in fact enjoyed account your blog posts.
    Anyway I will be subscribing to your augment
    and even I achievement you access consistently rapidly.

  58. vaibhav verma August 6, 2014 at 7:51 am #

    everything is working fine , user can login to my app but how to logout from facebook if another user wants to user different login ID on same device. ?? please help

  59. frz August 7, 2014 at 8:09 am #

    the main point of the cordova facebook plugin is that it uses the facebook app to log you in and degrades gracefully, your code moves the focus to another browser window which defeats the purpose.
    You should look at using display type ‘touch’ at least so the focus remains in the same window view.

  60. Felipe Furlan August 12, 2014 at 12:33 pm #

    Yes, work 100% thanks for the article!

  61. Luke Snowden August 18, 2014 at 2:28 pm #

    any chance you can answer this, a lot of folk would appreciate it

  62. Luke Snowden August 18, 2014 at 2:28 pm #

    any chance you can answer this, a lot of folk would appreciate it

  63. David Vielhuber August 20, 2014 at 6:16 pm #

    Hello Christophe,

    thank you for your awesome work.
    The plugin worked like a charm.

    I’ve added a pull request on github,
    looking forward for your answer.

    Best greets

  64. klima servisi August 23, 2014 at 6:23 pm #

    Harika Bir site, Mükemmel paylaşımlar Admin ellerin dert görmesin

  65. Charalambos August 26, 2014 at 12:21 am #

    Hello Christophe,
    very nice your article and your library help me very well.
    I try the script, work perfectly on browser but with cordova i got the warning “The redirect URL must be absolute”.
    You have any idea?
    thank you very much.

    • sadiveor September 27, 2014 at 1:12 pm #

      Hello i got the same problem did you found a solution ?

      Thank you very much

      • Peter December 6, 2014 at 12:42 pm #

        Me too guys having the same issue, any ideas please? Tks

  66. Bhagyashree August 27, 2014 at 8:58 am #

    Very Nice Plugin !!

  67. Robson Braga September 8, 2014 at 4:12 pm #

    Awesome addon! Works like a charm. Thanks a lot!

  68. Miguel September 10, 2014 at 2:08 pm #

    How to logout and login diferent user.

  69. ABDows September 15, 2014 at 3:48 pm #

    Not working on windows phone. Including your exemple.
    get error : Can’t reliably guess the Oauth redirect URI.Please specify it explicity in openFB.init()

  70. Mohini September 27, 2014 at 7:27 am #

    Hello all,

    Anyone got solution for not getting the Success or done window closed.

    I am facing this problem for iphone though it’s working well for android.

    Please do the needful.

  71. Dor September 27, 2014 at 11:56 am #

    How do I use this library to open facebook apprequests dialog?

  72. Fernando October 8, 2014 at 1:27 pm #

    Great Job! I am going to try that now!

  73. Alberto October 9, 2014 at 4:01 am #

    I’m still receiving the “SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.”. Those solutions about setting the didn’t worked for me.

    Any ideas?

    Thanks in advance

    • Alberto October 10, 2014 at 3:19 am #

      I realized that loginWindow_loadStartHandler(event) is not firing. Im working with android, cordova, inappplugin and launching it in a device. Any ideas? please help me

      • Franco August 8, 2015 at 7:00 pm #

        I have the same issue…
        I’m working on it, to see why the even it not being fired, without luck.

        Any thoughts?

        • Franco August 8, 2015 at 9:39 pm #

          OK, as we all know it was my bad…
          I found the issue:
          – First I was redirecting to the default, and as it wasn’t on the same domain, I wasn’t able to get the event listeners to work.
          – I used the re-directs provided with the library at init, redirecting to: oauthcallback.html
          – And after fixing and issue with Angujar JS and the routing mechanism I was able to make it work.


  74. Nitis October 10, 2014 at 7:12 am #

    This plugin works really good. Thank you for your work and this amazing website here!

  75. Fernando October 12, 2014 at 5:35 am #

    Great Tutorial! I am building a PhoneGap app. What URL should I use for the Valid OAuth redirect URI?

    I guesse there is no http://localhost/openfb/index.html and I don’t know what adress my app will have.

  76. Rodrigo October 13, 2014 at 11:32 am #


    My app is running in phonegap, but got error: “URI must be absolut”

    The var oauthRedirectURL is set as ‘file:///android.asset/outhcallback.html’.

    How can i fix this error?

    My source is in github –


    • Peter December 6, 2014 at 1:45 pm #

      Hi Rodrigo, did you figure this out?! Thanks.

  77. Peter Holcomb October 20, 2014 at 2:56 pm #

    Just wanted to say thanks for putting this together and open-sourcing it. I was able to use it pretty easily in an angular/cordova project I’m building. Very cool deal to not have to use the facebook plugin and have to debug in the emulators. Cheers,

  78. Anand October 25, 2014 at 6:18 am #

    The code works fine in mobile browser as well as system browser. But Inside the app after fb login credentials are entered, gives a white screen and in my console the following errors comes up. Can you please solve this?

    Uncaught TypeError: Cannot call method ‘oauthCallback’ of undefined at

  79. harley October 28, 2014 at 10:05 am #

    hey dude why don’t you rewrite the article with a step by step tutorial with pictures ?
    it is hard to follow and we must struggle with the comments to get something working properly.

    thank you for sharing by the way.

  80. jouni November 4, 2014 at 5:54 am #


    your logout doesnt work correctely

    il still connect to application(even if token has undeifined value) if i already connected to my facebook page

  81. Azura November 4, 2014 at 12:29 pm #

    Hi, have anyone tested this plugin on IntelXDK?
    I keep getting the “Given URL is not allowed….” error.
    I tried one of the solutions provided by the people here but it still does not work!

  82. Rodney November 5, 2014 at 4:51 am #

    Thanks for sharing.

    After fb loging I get this error:

    Facebook login succeeded menuCtrl.js:78
    exit and remove listeners openfb.js:115
    Error in error callback: InAppBrowser457255868 = ReferenceError: deferredLogin is not defined

    Anyone seen that before? Nothing in Google!

  83. Marcella November 5, 2014 at 11:43 am #

    So far this is working great, thank you for this!

    However, I’m running into an issue where the webkit-playsinline setting on my videos in my app no longer work after the loginwindow.close() function is called. It works fine without Facebook login but the minute I leave the app using openFb and come back it’s broken (videos are playing in native fullscreen player). Any thoughts?


    • Marcella November 5, 2014 at 12:44 pm #

      Nevermind, I edited your function call to include ‘allowinlinemediaplayback=YES’ in the options parameter.

  84. Usman November 5, 2014 at 4:38 pm #

    first of all, Thanks a lot for this superb tutorial.

    I have a question about Facebook APP

    how did you configure your Facebook APP (Sociogram) to get information?? i have created my Facebook APP but after login it goes to success page and give an error..


    • Azura November 5, 2014 at 8:24 pm #

      Make sure you have InApp Browser as a plugin, have the oauthcallback in the root directory

      • Usman November 6, 2014 at 4:16 pm #

        Thanks for the reply.. i was talking about something else.. but i have resolved that issue…

        anyone fixed the logout issue?

  85. brad November 14, 2014 at 7:06 am #

    thanks for the plugin works great :)

  86. Mogens Enevoldsen November 18, 2014 at 4:07 pm #

    After facebook login I get the following error:
    ReferenceError: Can’t find variable: deferredLogin

  87. Agustin November 26, 2014 at 2:36 am #

    For all of those receiving a “Success” white screen… my problem was that I was using Ionic Framework and apparently the lines

    document.addEventListener(“deviceready”, function () {
    runningInCordova = true;
    }, false);

    were never triggered. My hardcoded solution was to set by default the deviceready variable to true. I imagine there must be a nicer solution but I don t have time for it….


  88. Raja Husnan November 26, 2014 at 12:04 pm #

    thanks its work, thanks for OpenFB is a micro-library that lets you integrate your JavaScript application with Facebook

    i implemented in my android apps,… thats work!!!!
    for based what i implemented: facebook developer Valid OAuth redirect URIs just fill =

    2.dont forget to add plugin for inappbrowser if u use this OpenFB for apps android(“in my case”)

    3.just use default openfb.js no need to change any script..

    4.dont forget the openFB.init({appId: ‘xxx’});

    NB: just try login() and getinfo() its work!!!

    thanks for sharing this………… in open source!!!!

  89. Rob November 30, 2014 at 10:14 pm #

    After being plagued by this issue for a couple of days, I found a solution to my “Given URL is not allowed….” error: remove all platforms from your Facebook app configuration.

    What do you enter for your site URL? Nothing, because when you create a new Facebook app that component is not added. If it is there, Facebook will enforce that requests come from the specified URL.

    Thanks for the library Christophe!

    I hope this saves someone else some time…

  90. Fernando December 3, 2014 at 3:03 am #

    Still getting that

    SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.

    How come?

  91. Pravin December 5, 2014 at 3:01 pm #


    to close the inappbrowser – “ref.close();”

    implement something like this

    var ref =‘’, ‘_blank’, ‘location=yes’);
    // close InAppBrowser after 5 seconds

    setTimeout(function() {


    }, 5000);

    • Yoni December 9, 2014 at 9:10 am #

      Can you be more specific?

      The line in openfb.js is:
      loginWindow = + ‘?client_id=’ + fbAppId + ‘&redirect_uri=’ + oauthRedirectURL +
      ‘&response_type=token&scope=’ + scope, ‘_blank’, ‘location=no’);

      where oauthRedirectURL is the facebook success page.
      How can I identify that the success page was called and close the page (to get back to the app)?

      It is very frustrating that I’m getting the “Success” message but can’t get back to the app.

      I think it will also be a good idea to collect the 2-3 problems that are discussed here and add them to the post as update, it will save new-comers a lot of time.

  92. Pravin December 5, 2014 at 3:01 pm #


    to close the inappbrowser – “ref.close();”
    reference –
    implement something like this

    var ref =‘’, ‘_blank’, ‘location=yes’);
    // close InAppBrowser after 5 seconds

    setTimeout(function() {


    }, 5000);

  93. Alberto December 8, 2014 at 3:44 pm #

    Hi, I already make it work but I see that this code is for friends list
    openFB.api({path: ‘/me/friends’, success: successHandler, error: errorHandler});

    But how can i display them or share something with a friend


  94. sayak December 9, 2014 at 5:10 am #

    hi, login and get info working well. but when i post something it appeared on my own timeline on facebook but noone can’t view it though it shared publicly. what are the permissions required in facebook app setting? does anybody know what is the problem??


  95. Firoz Shaikh January 3, 2015 at 2:31 am #

    Everythings Works Perfect!
    Thanks You!

  96. oby January 10, 2015 at 6:12 am #

    i need a solution… i integrate your plugin with ionic && cordova for multi devices app ;-)

    first : thank a lot for plugin.. it’s work a charm with ionic serve and good auth option in fb app settings..

    BUT : with ionic run android (key hash android generated and integrated) not functionnaly !!!

    error is :

    the redirect uri url must be absolute
    or error connection refused (tested with wifi with good ip auth for fb app)..

    i’ve no solution… i test param app ionic with $httpProvider.defaults.useXDomain = true;
    or others… ned help for only connect facebook (my server api work fine)


  97. Gaston January 19, 2015 at 5:38 pm #

    Hi cristopher, i need to show wall posts from facebook page. Only show. Can i do that?

  98. Chaitanya Khurana January 24, 2015 at 3:51 pm #

    Thanks for sharing such a beautiful code! It works like charm. The only issue is that the console displays an error message:

    “deferredlogin is not defined”

  99. Meganathan January 31, 2015 at 8:15 am #


    This is Meganathan. When i test this script in web, its working fine. But if i test in phonegap/ios returns the below error:

    SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone. See the Facebook Help Center for more information.

    Anyone, please help me.

    Thanks and Regards,
    Meganathan P

  100. anonymous February 8, 2015 at 8:15 am #

    This may sound like an stupid question sorry, when creating the facebook app, I get different choices, iOS, Android, Website, what do I choose? thanks a lot.

  101. sonya February 8, 2015 at 10:59 pm #

    quick question, i can login well in ionic and post to the wall also, the only problem I am having is the logout feature.



    $scope.fbLogout = function () {
    function () {
    alert(‘Logout successful’);
    function errorHandler(error) {

    when I click on Logout I go redirected to my FB main page (wall) for a second and then back to my app page. the second time I click on logout, i will see the logout successful alert on my app page and that’s all. I am still however logged into FB. What I don’t have anymore is the token. So basically the logout erase the token BUT still keeps me logged into FB. I saw that in the openFB.js there is a line that says:

    * Logout from Facebook, and remove the token.
    * IMPORTANT: For the Facebook logout to work, the logoutRedirectURL must be on the domain specified in “Site URL” in your Facebook App Settings

    The problem here is that I did not add any platform to be used because I am running the app in ionic framework and I do not need an specific platform. Therefore, I don’t have a Site URL to fill in. Besides, if I would for example add a WEBSITE Platform and then see a Site URL field, I wouldn’t be able to add a URL because I don’t have any.

    Anyone have any thoughts on this? thanks a lot, GREAT CODE, two thumbs up!

  102. HeartyBank February 9, 2015 at 11:40 pm #

    For anybody who still have problems related to “Redirect_uri URL must be absolute on Cordova. I just solved it successfully and tested many times until i’m sure how to solve it. Here are what you need to do to make it works. (on Android only!)

    1. in the tag, arrange the script tags like this

    No matters how many js files you want to add. Just list 3 above files as first set.

    2. Make sure you installed in app browser plugin properly.

    3. You don’t need to change anything in openfb.js file.

    4. And you also don’t need to specify Redirect URL in FB’s App Setting page. Just leave it blank.

    5. Use the sample code you download from OpenFB’s github (latest version). It works perfectly.

    6. In the FB’s App Setting Page… I set these things as “yes” , you can try set these same as me. maybe it can work even thought you don’t do the same.

    Advanced Tab
    – Native or desktop app
    – Is your App Secret embedded
    – Client OAuth Login
    – Embedded browser OAuth Login

    Basic Tab
    – Add Android Platform with Single Sign on
    – Add Website URL

    After doing all above things, I make it works without any problems. Just try do the same things as mine. Hopefully this will help everybody. Cheers!

  103. ashdiuhasiurgais February 14, 2015 at 12:48 am #

    people having trouble with white or blank screen is because they copied and pasted the code but haven’t declared the variable errorHandler

  104. Joe Arredondo March 30, 2015 at 3:03 pm #

    Hi there, there is a way to redirect to another page when the login is complete? mi client needs only validate the account of the user and after that just send it to the main page of the site…..

  105. Joe Arredondo March 30, 2015 at 3:11 pm #

    Hi there… there is a way to redirect to a page in the same site when user has done login? i need to know if that is possible using this plugin

  106. junaidy April 5, 2015 at 4:55 am #

    how to solve this:
    alert (#200) requires extended permission: read_stream
    after login in sociogram

  107. raza2022 April 6, 2015 at 7:53 am #

    first time used in my app and working superb. Thanks Man
    more one thing, is similar module for google+ sign in

    • Niketa May 11, 2016 at 8:53 am #

      Did you find anything for Google + ?

  108. rojin April 7, 2015 at 4:40 am #


    Let me know, How can i come back to my app index page after login success?. Right now this goes to /login-success.php . PLZ help me

  109. Martin April 8, 2015 at 3:40 pm #

    Hello Coen,

    I’m using the above script and it is working great! One thing that is not working, is when i log out and want to login again. Nothing is happening when i click my login button.

    Have you got any idea what could be wrong?


  110. Zweni Nkabinde April 17, 2015 at 3:06 am #

    Hi Christophe

    This is the best solution I’ve come across so far. Thanks for putting your time and sharing with the community.

    I have done exactly as you have stated in the readme and everything worked.

    If anyone is struggling with this, I can help out as I have it working in Cordova (using Telerik AppBuilder and Cordova 3.x)


  111. chandu April 21, 2015 at 12:20 am #

    thank you so much awesome work. It really helped me more than expected.!! Thank you!!!!!!

  112. necoide April 23, 2015 at 1:38 pm #

    Excellent work!

  113. Franck May 14, 2015 at 5:20 am #

    when i try to log in with my browser i get this message

    can’t reliably infer the OAuth redirect URI.please specify it explicitly in OpenFB.init()

  114. nettii June 6, 2015 at 5:30 am #

    Hi, I have a problem after succes login. I can see a screen that show this:

    SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.

    and can’t get back to my app from it.

    anyone help me please?

    Thanks in advance

  115. Iván Coppes June 22, 2015 at 4:42 pm #

    Great work !!

    Thanks you.

  116. Mayank June 22, 2015 at 11:37 pm #


    I’m also facing a same problem after successful login and showing the screen containing following message.

    SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.

    No unable to go back to my app from it.

    I show many of them having same issue, can anyone let me know how to resolve it?


  117. Vijaya July 23, 2015 at 3:10 am #

    Followed all the steps for fb logn but unable to login using mobile device. It throws error : not logged in, Try logging in.

    I am unable to run this in my browser to check if it works too

  118. chris July 23, 2015 at 11:58 am #

    Hi, is the FB plugin work with Cordava version 3.5.1 above, I understand that it can’t ? Anyone can help as my application was build under the old pre 3.5.1 version which has vulnerabilities

  119. Avi August 2, 2015 at 8:22 am #

    Thank you very much.
    Helped me a lot.

  120. Krushnat August 6, 2015 at 3:35 am #

    I am working in development. I don’t have any hosted website url.
    I am creating a phonegap application where login with facebook to be used.
    So what should be my oauth success uri URL?

  121. junk September 10, 2015 at 3:50 am #

    hello coenraets, i have an problem while calling the logout function in ionic. it opens the home.php window when i called. i think the facebook api are not understanding the url those are created inside the function inside the open.js file. can you help me to get rid from it.?

  122. anil September 30, 2015 at 10:15 am #

    Hi iam using this its working but iam stucking at getting frinedslist
    i tried this openFB.api({path: ‘/me/friends’, success: successHandler, error: errorHandler});

    it showing response as empty {“data”:[]}

    how to solve this

  123. anil September 30, 2015 at 10:17 am #

    Hi how to get friends list?

    iam triend your code but getting empty data

  124. ssss October 12, 2015 at 6:08 am #


  125. Tolik October 23, 2015 at 9:08 am #

    It looks like there an error when I try to test your login app from the link you gave in the tutorial I redirect to Facebook login page log in and than nothing happened I stay at Facebook login page and I see a clear white page

    I’m using my smartphone by the way any idea?

  126. forma imalatı November 17, 2015 at 8:53 am #

    quality, reliable, cost-effectiveness and the associated jobs are done imalattan.rofesyonek team.

  127. forma imalatı November 17, 2015 at 8:54 am #

    Fabrics we use in our form; The first-class micro-interlock; flex-fit, anti-bacterial, it has a thermo-balance, and immediately drying. This gives you the freedom to move your soccer jerseys of the match; It is designed stylish enough to be worn on a daily basis. Our models are produced in two types as my special jerseys and other digital printed.
      His highest production of our company, we use the sport socks products: cotton, cotton, polyester, nylon and lycra. It includes anti-bacterial.

  128. sohbet odalari December 8, 2015 at 5:16 pm #

    oho oho very nice to blog admin baba en

  129. hoojianliang December 8, 2015 at 9:34 pm #

    HI, I am developing mobile apps. Since mobile have facebook app and broswer, I would like to ask is this API are able to connect to my fb account from facebook apps but not from the broswer?

  130. idan December 15, 2015 at 12:47 am #

    Hello ,
    I’m having cordova app that works on android with openFb ,yesterday I deployed this app to iPhonea 4s , the openFb works and facebook login appears but redirect me to “Success” … “Security warning ….” page instead to my app (as in the android).

    any idea what is the problem ?

    • itsme me July 17, 2016 at 2:22 am #

      hii did u solved this problem? im also getting same problem android working fine but iphone getting problem same as like u

  131. Ibad December 30, 2015 at 7:27 am #

    This is an awesome tutorial so far I have seen on this topic. Great Job!

    I would love to have something similar for paypal integration for phonegap build too. I have literally tried everything but I am unable to integrate paypal with my phonegap+jquerymobile app.

    Thank You.

  132. Ole January 22, 2016 at 3:12 pm #


    I have successfully used OpenFB in my Phonegap app, but after upgrading to iOS 9.2.1, I only got an empty window with black bar in the buttom, where I can click on “Done”.

    Log says:
    webView:didFailLoadWithError – 102: Frame load interrupted

    I’m I the only one seeing this problem? I got an iPad with iOS 9.2 where it works like charm.

    Any help appreciated.



  133. Ankit February 2, 2016 at 8:55 am #

    This facebook integration is taking local regional langualge, how will i set it default to english.

  134. John Troxel April 6, 2016 at 12:39 pm #

    We are using a very similar approach. Only Facebook is so far rejecting our app in the review: “Your app cannot embed the Facebook Login dialog inside a custom web view. Utilize our native Facebook Login SDK, so that users do not need to login twice.” We’re trying to get to the bottom of what they mean.

    Has anyone else gone through the approval process with a no-plugin approach?

    – John

  135. Niketa May 11, 2016 at 8:51 am #


    Do you know any such package which can give similar functionality for Google +

  136. Hitesh Maniya September 18, 2016 at 12:14 pm #

    I have check in website and it’s working but when i check with cordova app it’s giving error “Domain of this url is not allowed in your app domains

  137. Rig Nortana September 23, 2016 at 9:20 am #

    Phonegap ios /android:
    when i try to click on login button its display this error :
    Can’t Load URL: The domain of this URL isn’t included in the app’s domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.

    • myedumantra September 15, 2017 at 3:44 am #

      is this error sorted as i’m having the same problem

  138. Quintin De Bruyn October 22, 2016 at 4:42 am #

    I cannot thank you enough, been sitting on this for 3 days, any other method failed. This one is great !!!! A quick question, I’m using this on Phonegap . how can I prevent user having to enter credentials manually when logging in, can’t I just have the details pulled from the native facebook app ?

  139. Mohamad Fahmi April 24, 2017 at 4:37 am #

    can be use to facebook comments?

  140. Praful Kalpund January 6, 2018 at 1:25 am #

    Hey nice work.
    Simple and working perfectly.

    I have one query..!!
    When i install my app first time, and try to login using facebook it give me facbook login window which is perfect. But if I already have Facebook android app installed on my device then it should take data direct from that app. So my question is how to get access token from Facebook android app in my app?

  141. CIIT Noida April 25, 2018 at 2:55 am #

    Keep on posting these types of articles. I like your blog design as well. Cheers!

    Best B.Tech College in Noida

  142. CIIT Noida May 1, 2018 at 4:50 am #

    Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.

    Best Linux training in Noida
    Linux Training Institute in Noida
    Shell Scripting Training Institute in Noida

  143. radiancevision group May 8, 2018 at 8:39 am #

    Its very Informative blog I learn many more things in this blog keep sharing.
    Digital Marketing

  144. yuvaraj singh November 24, 2020 at 2:46 am #

    Thanks for sharing this informative content , Great work
    To crack Agile coach interview : Agile coach Interview Questions

  145. yuvaraj singh February 22, 2021 at 3:52 am #

    Thanks for sharing this content.,
    Leanpitch provides online training in Scrum Master during this lockdown period everyone can use it wisely.
    Join Leanpitch 2 Days CSM Certification Workshop in different cities.

    CSM certification online

    CSM online

    CSM online certification

    Scrum master certification online

    CSM online training

    CSM training online


  1. Cordova/PhoneGap Facebook Integration without Plugin | SDK News - April 7, 2014

    […] Cordova/PhoneGap Facebook Integration without Plugin […]

  2. Tutorial: Integrate Facebook without Plugins (PhoneGap) - April 8, 2014

    […] and made direct HTTP request to Graph API. The whole tutorial and source code you can find on his blog. Have […]

  3. Checklist for setting Facebook Connect for PhoneGap | TienLe's Blog - May 22, 2014

    […] list out some checklist for setting Facebook Connect for PhoneGap – Ionic. We will use the Simple Facebook Connect without PhoneGap plugin to be able to login with Facebook in your […]

  4. Facebook mobile login: come integrarlo in un’applicazione HTML5 | upCreative - June 13, 2014


  5. PhoneGap Facebook Plugin – maintenance update | Shazron's Cordova (aka PhoneGap) Blog - July 13, 2014

    […] you could try a JavaScript only solution, read this blog post and browse the ( This JavaScript only solution has some […]

  6. Cordova Facebook Login – User Information - August 3, 2014

    […] I have used the following tutorial to integrate facebook login with cordova. […]

  7. Sociogram: A Pattern Software demonstrating AngularJS/Ionic and Fb Integration | PakUltimate - October 24, 2014

    […] a makeover: Here’s a model new model of Sociogram, constructed with AngularJS, Ionic, and the OpenFB micro-library I shared earlier this […]

  8. Can Facebook JS SDK work with Phonegap / Cordova? | Some Cordova Questions and Answers - July 6, 2015

    […] […]

  9. Mobile Web Weekly No.2 | ENUE Blog - August 17, 2015

    […] Cordova/PhoneGap Facebook Integration without Plugin […]

Leave a Reply