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:

openFB.api(
    {
        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.

Pros:

  • 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.

Cons:

  • 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.

openfb

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: https://developers.facebook.com/apps. 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 https://www.facebook.com/connect/login_success.html 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

Summary

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.



104 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 #

      Hi,
      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.

      Thanks,
      Christophe

      • 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 -
        Success
        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=”http://phonegap.com/ns/1.0″ 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)

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

        hello
        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

        Regards

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

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

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

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

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

    Hi
    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

    index.html
    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.

      https://developers.facebook.com/docs/facebook-login/permissions/

      • 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 = ‘http://example.com/’,
      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 :)

  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 #

    Hey,

    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

    • 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 #

    Hi,

    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.
      Thanks.

      • 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.

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

        Where we have to add that inappbrowser plugin???

      • 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 #

    Hi,
    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 #

    Hi,

    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.
      Thanks

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

        Hi,
        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 #

      Soroush,

      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.

      thanks

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

    HI,

    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. pen.io 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

  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 : http://www.raymondcamden.com/index.cfm/2013/11/5/Ripple-is-Reborn

    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?

    Thanks!

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

      same issue here.. any ideas?

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

    Hey,
    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?

    Thanks!

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

    Hi,

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

    Any idea?

    Thanks!

  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?

    See: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/picture

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

    openFB.api({
    path: ‘/me/picture’,
    params: {
    redirect: ’0′,
    height: ’200′,
    width: ’200′,
    type: ‘normal’
    },
    success: function(data) {
    console.log(JSON.stringify(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:
          ‘https://graph.facebook.com//picture?type=large’

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

            you need to add user_id after .com/

  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 #

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

    Thanks in advance.

    Regards

  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

    newapp\www\index.html
    newapp\www\oauthcallback.html
    newapp\www\openfb.js

    so oauthentication url should be like following ??
    http://localhost/oauthcallback.html

    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 ?

    Thanks.

  46. soup.io 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 https://www.facebook.com/connect/login_success.html 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 https://www.facebook.com/connect/login_success.html 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 = ‘http://example.com/’,
      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.
          Delete
          baseURL = location.protocol + ‘//’ + location.hostname + (location.port ? ‘:’ + location.port : ”) + context,

          and direct change to

          example: baseURL = ‘http://example.com/’, //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 developer.facebook.com 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.

  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. go right here July 20, 2014 at 12:58 pm #

    At this time it appears like WordPress is the top blogging platform out there
    right now. (from what I’ve read) Is that what you are using on your blog?

  59. Natraj July 22, 2014 at 2:34 pm #

    thanks for tutorial. it helps me alot.

  60. Worker July 23, 2014 at 7:29 pm #

    How is this guy not the President yet?Awesome stuff,I must say!

Trackbacks/Pingbacks

  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

    […] LINK ALL'ARTICOLO SORGENTI LIBRERIA DEMO […]

  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 (https://github.com/ccoenraets/OpenFB). This JavaScript only solution has some […]

Leave a Reply