Comments (10)
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.
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.
@jebarius How do you handle the POST request signed_request?
from angular-easyfb.
@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.
@Urigo did you ever figure this out?
from angular-easyfb.
@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.
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.
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.
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.
😄 👍
from angular-easyfb.
Related Issues (20)
- Facebook Comment And Like Track HOT 9
- Page Plugin not loading on iPad Safari iOS 9.2.1 HOT 1
- "Main" field in package.json is wrong HOT 2
- Upload photos from camera source HOT 3
- Won't initialize when `xfbml: false` given
- Unsupported Browser:: Facebook login does not work from chrome on iPhone. HOT 2
- Minified version of 1.4.4 causes injector error HOT 2
- Dynamic set the locale HOT 2
- Get ezfb to work with import HOT 2
- To show all public posts that are present in Page or a person in facebook?? HOT 3
- apk file created by android studio using ionic framework not working HOT 2
- facebook endpoint changed from *.net to *.com HOT 2
- Angular2 Version? HOT 2
- can i make the custom fb like button and call some controller function on click of that button. HOT 1
- doesn't render FB login button after navigating to different page and back HOT 3
- long-lived token
- How to use fb-login-button directive HOT 1
- In Android device error getting the sdk
- Login Button doesn't work HOT 3
- No way to exchange short-term tokens for long-term tokens
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-easyfb.