Code Monkey home page Code Monkey logo

facebook's Introduction

Kdyby/Facebook

This repository is abandoned. Create an issue if you would like to take over the maintenance.

Suggested alternative: https://github.com/thephpleague/oauth2-facebook


Build Status Downloads this Month Latest stable Join the chat at https://gitter.im/Kdyby/Help

Facebook PHP SDK with authorization for Nette Framework

Requirements

Kdyby/Facebook requires PHP 5.3.2 or higher with cUrl extension enabled.

Installation

The best way to install Kdyby/Facebook is using Composer:

$ composer require kdyby/facebook

Documentation

Learn how to authenticate the user using Facebook oauth or call Facebook's graph api in documentation.


Homepage http://www.kdyby.org and repository http://github.com/Kdyby/Facebook.

facebook's People

Contributors

dzindra avatar enumag avatar foowie avatar fprochazka avatar integer avatar jsifalda avatar kukulich avatar markfrydrych avatar martinmystikjonas avatar ondrejmirtes avatar paveljurasek avatar petrjirasek avatar spamercz avatar stekycz avatar uestla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebook's Issues

Undefined index: appsecret_proof

Not sure what changed. We start getting this notice after upgrade:

PHP Notice: Undefined index: appsecret_proof in /var/www/flowlist/libs/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php:217

Problem occures in code from my PR #22. But I'm not sure why this error show now.

So the question is: should I fix my code (add isset check) or is this unintentional side effect of some other change and should be fixed elsewhere?

Strange symbols in URL

After a successfull login, there are these #_=_ strange symbols in URL. How could I remove them?

Deprecated facebook-php-sdk

Původní fb knihovna byla nedávno označena jako deprecated ( facebookarchive@8e7e795 ) a nově se má požívat jiná verze sdk.

Bude na to kdyby/facebook nějak reagovat? Rozhoduju se na čem založit přepis současné app, která využívá staré api. Díky

Pagination Graph API

Ahoj (Dufam ze mozem pisat po slovensky, ak nie prepisem do ENG).

Je mozne, aby som pomocou tejto kniznice presiel resp. urobil request na graph API, pomocou pagination ? Nechcem vyuzit externe CURL requesty.

Co potrebujem je:

  1. Urobim call na /me/feed
  2. Vrati sa mi N vysledkov + pagination
  3. Chcem urobit dalsi request pomocou pagination->next
  4. Znova dokolecka, kym mozem.

UPDATE:
Neviem preco mi /me/feed nevracia property "cursors".
/me/likes mi polozku "cursors" vracia.

toto je polozka "paging" pre response /me/feed

Nette\Utils\ArrayHash Object ( [previous] => https://graph.facebook.com/v2.4/464067317094209/feed?since=1437678292&access_token=CAAUhWEafNP8BALuCUBAYOSTJvJt0stNyyrH2P2uM5ailBmZB2rXcBxuI5N5oqg9vkZBWCdPlBBfs9ZASDFEFZCCwvTJyXUaUBdGnHa96VkInuJcZB1efd5VlZC8dtwGOly4fZBgVAjMLjcKq1s0fh3AWvsdUMJ3lNsR9SM3t8HzeocCTBStbyrsvHnTREaqwNZBlnv4DvJvCFRnf0xqDq3Ho&limit=25&__paging_token=enc_AdBDWqKZCxWOzXUgNOXZBRhOhRj172cvyV4kRy9YOCJhh2XOZBUG1WJTCRnsZCwDE9ZC77QTGMo33lfvz44MZCuAfzkZCiy0h1lbKhFotBV6luNlti8wQZDZD&__previous=1 [next] => https://graph.facebook.com/v2.4/464067317094209/feed?access_token=CAAUhWEafNP8BALuCUBAYOSTJvJt0stNyyrH2P2uM5ailBmZB2rXcBxuI5N5oqg9vkZBWCdPlBBfs9ZASDFEFZCCwvTJyXUaUBdGnHa96VkInuJcZB1efd5VlZC8dtwGOly4fZBgVAjMLjcKq1s0fh3AWvsdUMJ3lNsR9SM3t8HzeocCTBStbyrsvHnTREaqwNZBlnv4DvJvCFRnf0xqDq3Ho&limit=25&until=1434891288&__paging_token=enc_AdBj5DpHVChFwXE8IFYNwsZCbAN059fF2ZCjDye83XtqzUod0mAcuKD3ErehG1HN3Nmsd10TOX5zZCNRExSy1ypB4seqJKyDnWWnhmm6qtgjRcvDgZDZD )

login doesn't work anymore

Hi,

Suddenly, the login is not working anymore. I get this message from facebook:

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 sub-domains of your app to the App Domains field in your app settings.

But on facebook app settings I added domain, subdomains, etc.

Have any idea why stopped working? Obvious worked before. Thanks for nice work!

Unable to edit redirect_uri & redirect_uri

Hey,
Is there any reason why there's no possibility of changing redirect_uri & cancel_url params to something other than $this->currentUrl ?

May this be possible in any future update? (I'm keen to prepare a pull request with this)

Thanks.

Graph Api 2.4 ('/me') returns name and id only

I have setup new Facebook app and it is under the api version 2.4. When I call php $fb->api('/me'); it returns name and id only... What I need is email as well. Any ideas?

All works perfectly with 2.0 and 2.2 (other fb apps I'm using)

PHP 7.2.7 - Use of undefined constant CURLOPT_CONNECTTIMEOUT

Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' (this will throw an Error in a future version of PHP)

anybody know what will be the replacement of this constant, on php pages there is no mention about it

Using without session

We need to call GET /me for every given access token in ReactPHP CLI script. Kdyby\Facebook\SessionStorage class depends on Nette\Http\Session which calls session_start(), which causes the following error in the CLI script:

Cannot send session cache limiter - headers already sent

Is it possible to use the Kdyby/Facebook without opening the session?

Traceback follows:

#0 /var/www/project/vendor/nette/utils/src/Utils/Callback.php(87): Nette\Http\Session->Nette\Http\{closure}('Cannot send ses...', 2)
#1 [internal function]: Nette\Utils\Callback::Nette\Utils\{closure}(2, 'session_start()...', '/var/www/projec...', 96, Array)
#2 /var/www/project/vendor/nette/utils/src/Utils/Callback.php(96): session_start()
#3 /var/www/project/vendor/nette/http/src/Http/Session.php(99): Nette\Utils\Callback::invokeSafe('session_start', Array, Object(Closure))
#4 /var/www/project/vendor/nette/http/src/Http/SessionSection.php(54): Nette\Http\Session->start()
#5 /var/www/project/vendor/nette/http/src/Http/SessionSection.php(225): Nette\Http\SessionSection->start()
#6 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/SessionStorage.php(135): Nette\Http\SessionSection->remove()
#7 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Facebook.php(602): Kdyby\Facebook\SessionStorage->clearAll()
#8 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php(383): Kdyby\Facebook\Facebook->destroySession()
#9 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php(197): Kdyby\Facebook\Api\CurlClient->resolveAPIException(Array)
#10 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php(166): Kdyby\Facebook\Api\CurlClient->callOauth(Object(Nette\Http\UrlScript), Array)
#11 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Facebook.php(173): Kdyby\Facebook\Api\CurlClient->graph('/me', NULL, Array)
#12 /var/www/project/app/model/TokenServiceRepository.php(70): Kdyby\Facebook\Facebook->api('/me')

Errors in tracy panels

During the login process all panels seem to not work, please see screenshot to better understand the problem.

screenshot

Though everything seem to work as intended except those error messages.

PHP Notice: Undefined index: request_header

PHP Notice: Undefined index: request_header in vendor/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php:239  @  http://www.example.cz/?do=fbLogin-response&state=<token>&code=<encoded>

Chybné request url při použití dodatečných parametrů

Když chceme použít dodatečnou selekci dat (třeba limit) v dotazu na Graph api nastává problém špatné request URL.

Pošleme do api:

$facebook->api('{page-id}/posts?limit=5');

výsledné url je:

https://graph.facebook.com/v2.1/{page-id}/posts?limit=5?access_token=......

Jak je vidět v url je zdvojený ? pro parametry a neprojdeme přez OAuth

An access token is required to request this resource. Code: 104

Parametr limit se dá odeslat jako 3tí parameter API, ale je nutné psát metodu akce (v tomto případě GET)

$facebook->api('{page-id}/posts', 'GET', [ 'limit' => 5 ]);

Při testování requestů v Graph API Exploreru vás to dost navádí psát parametry přímo do požadavku.

Is this repo dead?

Asking whether I should wait for PRs to be merged or manage my own fork. Thanks!

Logout from facebook

Hi,
How can I logout from facebook if Nette\Security\User has defined expiration and user is logout for inactivity? In this use case does't call event onLoggedOut.

I donť know if is new trial for login or old session. User does not close browser and anybody can login to your account via facebook.

Presenter is bad place for check it.


Ahoj,
jak mohu odhlásit uživatele z facebooku, když Nette\Security\User má definovanou expiraci a tento uživatel je odhlášen pro neaktivitu? V tomto případě se nevolá událost onLoggedOut.

Pokud je odhlášen pro neaktivitu tak v ten moment nevím zda se jedná o nové přihlášení nebo starou session. Pokud mi uživatel nezavře prohlížeč tak kdokoliv se může přihlásit přes jeho faceook účet.

Zjišťovat to v presenteru je pozdě.

Login without component

Hello,

Je mozne urobit login proccess bez komponentu ?
Chcel by som takyto flow urobit
/some/url
ked dojdem na actionUrl v presenteri SomePresenter chcem aby sa vykonal login flow, aby som to nemusel riesit cez componentu // resp ?do parameter v URLke

getPermissions() is returning only one permission

Is there any reason for Profile::getPermissions() to return only one permission?

Dumping $response in the method shows two granted permissions (I ask for e-mail in my app), but for some reason the method returns $response->data[0], which usually returns "public_profile" (which is always granted), making it pretty useless for actually checking permissions. No idea why would anyone want that... Is that intended behavior?

Passing ['email'] as param didn't help, but that just could be my lack of FB API knowledge, but even if that worked - I wouldn't want to call api many times to check permissions one by one, because... you know.

Release new version

Please release new version with last commits, ver. 2.0.1 havent support for nette 2.4 and i need stable dependency in composer.
Thanx.

Likes interface

Create a class for fanpage, that would allow you to check if user liked that page and communicate with it.

$fb->getUser vracia vždy nulu.

Ahoj, mám urgentný prípad, nainštaloval som Kdyby pomocou Composera, riadil sa dokumentáciou - nastavil config, použil kód z dokumentácie.

Facebook vracia OAuthException 2500 - blbý access token. Používam Facebook API v2.3 a staviame webovú a canvasovú aplikáciu. Nejaká nápoveda, čo sa mohlo posrať?

edit: Doplním, že aplikácia mi naozaj pribudne na Facebooku a naozaj som jej pridelil práva. Teda Facebookom to prejde.

Ďakujem za odpoveď.
Peter Bočan.

Error message with undefined constant

Hi, I got error message

Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT'

But I dont know why.. curl is enabled and version is 7.38.0

Thanks for help

New maintainer?

Hello everyone.
We're looking for a new maintainer for this repository. If you're using it in your project, I offer you to take over this repository.

It would be a great help for everyone and IMHO it's better than to maintain a fork :)

Double monitor on presenter overwrites parameters

We're trying to issue a rerequest on Facebook API via {link fbLogin-open! fbLogin-authType => 'rerequest'} (the parameter was introduced in #30). The problem is that Kdyby/Facebook's AbstractDialog adds its own monitor on IPresenter, while Nette by default adds a monitor on UI\Presenter.

Therefore the attached method gets called twice: In the first run, it pops the passed authType parameter from presenter's global space and passes it to the component, but in the second run it replaces the parameter with now empty array.

Does the monitor on IPresenter have some special purpose or can it be removed? Or is there some other way out of this?

(cc @Vboss)

Repace of Kdyby/Facebook/Diagnostics/Panel.php for Nette 2018-07-03

Depracted on line 170 of Kdyby/Facebook/Diagnostics/Panel.php:

`$client->onRequest[] = $this->begin;
		$client->onError[] = $this->failure;
		$client->onSuccess[] = $this->success;`

replace with

$client->onRequest[] = [$this, 'begin'];
		$client->onError[] = [$this, 'failure'];
		$client->onSuccess[] = [$this, 'success'];

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.