Code Monkey home page Code Monkey logo

Comments (10)

pc035860 avatar pc035860 commented on August 18, 2024

Hi @Urigo ,

Since the official Facebook JavaScript SDK works in Facebook canvas apps, I think easyfb should work just fine as well.

The authentication part is covered by the official SDK, and might not be a problem.

But I haven't actually tested it at all. So please let me know if it works or not. 😉

from angular-easyfb.

jebarius avatar jebarius commented on August 18, 2024

I've been working on a facebook app that uses this Library in a canvas app and it seems to work fine so far..
This is my first facebook canvas app so I've been learning alot from scratch but this library has been a massive help in developing the app.
I'll share a link once it's done.

from angular-easyfb.

Urigo avatar Urigo commented on August 18, 2024

@jebarius How do you handle the POST request signed_request?

from angular-easyfb.

blackfyre avatar blackfyre commented on August 18, 2024

@Urigo I developed quite a few facebook applications, even ones with heavy form usage...
The best course of action I can recommend, is that you should use ajax for sending and getting data from the back-end system, and if possible, completely dismiss the page refresh altogether...

@pc035860 Your library definitely works in a canvas application... at-least the FB.init, FB.ui, FB.api functions do... haven't tried the directives so far, but for most of them, you need rendered pages on the source server to work properly as the require an url to analyze... and because of this most won't work within a canvas app.

from angular-easyfb.

niiamon avatar niiamon commented on August 18, 2024

@Urigo did you ever figure this out?

from angular-easyfb.

blackfyre avatar blackfyre commented on August 18, 2024

@niiamon With a front-end angular app you don't need to mess with the signed request, because the JS SDK handles it.

With a backend (php) SDK the signed request is also handled within the SDK...

If you could provide a more detailed scenario maybe we could come up with a solution.

from angular-easyfb.

niiamon avatar niiamon commented on August 18, 2024

@blackfyre:

The goal is simple: in a front-end Angular app, how can I access either the signed_request or the parsed result from the signed_request?.

As I am running an Angular app within the context of a Facebook page chrome, I am interested in finding out which page my app is running within. That information is within the signed_request. But since Facebook can't POST the signed_request to the Angular app, then there's no simple way for the Angular app to get access to the signed_request and the information it contains.

In that scenario, apart from fronting the Angular app with a server that can receive the POST, how else can the Angular app receive the data from Facebook?

from angular-easyfb.

blackfyre avatar blackfyre commented on August 18, 2024

@niiamon

The FB.getLoginStatus method call has the signed request in the JS SDK (official docs: https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus), but that's an encrypted string and you won't have access to it's content, and is only available after the user logs into the app...

Only a backend SDK can decipher the contents of the signed request, as it's sent via POST to the url you've defined when creating your app, and that's also after the user tried to login into your app, and if this wasn't enough it requires the app secret code to decipher it. So this is basically for security reasons.

If you're looking for info on the page, you could look at the Graph API docs for the pages: https://developers.facebook.com/docs/graph-api/reference/v2.2/page/

For using with easyFB, you can do this:

ezfb.api(
    "/{page-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);

from angular-easyfb.

niiamon avatar niiamon commented on August 18, 2024

What I did was to wrap a Rails app around my Angular app and then mounted a route to receive the signed_request POST. That seemed the simplest way.

from angular-easyfb.

blackfyre avatar blackfyre commented on August 18, 2024

😄 👍

from angular-easyfb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.