TERA Callida - Cercle des Vanarchs Index du Forum



 FAQFAQ   RechercherRechercher   MembresMembres   GroupesGroupes   S’enregistrerS’enregistrer 
 ProfilProfil   Se connecter pour vérifier ses messages privésSe connecter pour vérifier ses messages privés   ConnexionConnexion 

How To Check If A Facebook User Likes A Page With Php

 
Poster un nouveau sujet   Répondre au sujet    TERA Callida - Cercle des Vanarchs Index du Forum -> ACCUEIL -> Requêtes et propositions
Sujet précédent :: Sujet suivant  
Auteur Message
valaielle


Hors ligne

Inscrit le: 31 Mar 2016
Messages: 134
Localisation: Toulouse

MessagePosté le: Mar 9 Jan - 23:50 (2018)    Sujet du message: How To Check If A Facebook User Likes A Page With Php Répondre en citant




How To Check If A Facebook User Likes A Page With Php
> DOWNLOAD (Mirror #1)










Join Stack Overflow to learn, share knowledge, and build your career. –Chris Jacob Mar 13 '12 at 1:29 3 You are not checking the validity of the signedrequest. Facebook allow apps to "Like Gate" access to content. I simply want to check if a user has liked my page with javascript in an iFrame app. "&pageid=" . Aquia RAR RecommendedAquiaDrupal associatiion membersMemberWise Recognised SupplierCrown Commercial Service Supplier Pedalo 2018 21-24 Millbank , London SW1P 4QP. ProductsFacebook LoginSharing on FacebookGamesFacebook App Ads. SDKsiOS SDKAndroid SDKJavaScript SDKPHP SDKUnity SDK. It's back! Take the 2018 Developer Survey today . Though Jason noted that requesting permissions is not ideal, I consider it a good thing since the user can reject it explicitly. SupportPlatform StatusDevelopers GroupMarketing PartnersBugs.. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count). Email Sign Up or sign in with Google Facebook How to check if a user likes my Facebook Page or URL using Facebook's API Ask Question up vote 100 down vote favorite 79 I think I'm going crazy. .. The basic code is rather simple: FB.api("me/likes/SOMEID", function(response) { if ( response.data.length === 1 ) { //there should only be a single value inside "data" console.log('You like it'); } else { console.log("You don't like it"); } }); ALternatively, replace me with the proper UserID of someone else (you might need to alter the permissions below to do this, like friendslikes) As noted, you need more than the basic permission: FB.login(function(response) { //do whatever you need to do after a (un)successfull login }, { scope: 'userlikes' }); shareimprove this answer edited May 23 '17 at 12:26 Communityf 11 answered May 29 '12 at 12:47 DrColossos 10.1k23256 add a comment up vote 3 down vote i use jquery to send the data when the user press the like button. Not the answer you're looking for? Browse other questions tagged facebook facebook-graph-api fbml fbjs or ask your own question. Join Stack Overflow to learn, share knowledge, and build your career. In a nutshell, if you turn on the OAuth 2.0 for Canvas advanced option, Facebook will send a $REQUEST['signedrequest'] along with every page requested within your tab app. ProductsFacebook LoginSharing on FacebookGamesFacebook App Ads. The act of liking can't be the entry mechanism, but you can enforce liking before entering. How can I get the current user's 'likes' in my situation? facebook facebook-graph-api fbml fbjs shareimprove this question edited Jan 16 '11 at 22:02 asked Jan 16 '11 at 3:44 jordanstephens 3,81422043 add a comment 4 Answers 4 active oldest votes up vote 11 down vote There's a way to do that without requesting permission and without using any kind of API. Also you can fire query using FQL apis. Here's another approach. Stack Overflow Questions Jobs Developer Jobs Directory Salary Calculator Help Mobile Stack Overflow Business Talent Ads Enterprise Company About Press Work Here Legal Privacy Policy Contact Us Stack Exchange Network Technology Life / Arts Culture / Recreation Science Other Stack Overflow Server Fault Super User Web Applications Ask Ubuntu Webmasters Game Development TeX - LaTeX Software Engineering Unix & Linux Ask Different (Apple) WordPress Development Geographic Information Systems Electrical Engineering Android Enthusiasts Information Security Database Administrators Drupal Answers SharePoint User Experience Mathematica Salesforce ExpressionEngine Answers Stack Overflow em Portugus Blender Network Engineering Cryptography Code Review Magento Software Recommendations Signal Processing Emacs Raspberry Pi Stack Overflow Programming Puzzles & Code Golf Stack Overflow en espaol Ethereum Data Science Arduino Bitcoin more (26) Photography Science Fiction & Fantasy Graphic Design Movies & TV Music: Practice & Theory Worldbuilding Seasoned Advice (cooking) Home Improvement Personal Finance & Money Academia Law more (16) English Language & Usage Skeptics Mi Yodeya (Judaism) Travel Christianity English Language Learners Japanese Language Arqade (gaming) Bicycles Role-playing Games Anime & Manga Puzzling Motor Vehicle Maintenance & Repair more (32) MathOverflow Mathematics Cross Validated (stats) Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more (10) Meta Stack Exchange Stack Apps API Data Area 51 Blog Facebook Twitter LinkedIn site design / logo 2018 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required. 020 8747 3274020 8747 3274020 8747 3274 Toggle navigation PortfolioServicesWho We AreOur BlogContact us Pedalo limitedportfolioServicesWEBSITE DESIGN & BUILDDrupal DevelopmentWordPress DevelopmentResponsive & Mobile Web DesignCharity web servicesUSER EXPERIENCE (UX)UX AuditCard SortingCompetitor analysisInformation ArchitectureUX Persona DevelopmentStakeholder Engagement WorkshopsUX SurveyStakeholder InterviewsCustomer Journey MappingWireframe DesignDIGITAL CONSULTANCYWEBSITE MAINTENANCE, MANAGEMENT & SUPPORTWho We AreOur BlogContact us. SDKsiOS SDKAndroid SDKJavaScript SDKPHP SDKUnity SDK. Your code only works if the user has granted an extended permission for that which is not ideal. more stack exchange communities company blog Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Log In Sign Up . USERTOKEN . .. shareimprove this answer edited May 23 '17 at 12:02 Communityf 11 answered Dec 28 '11 at 22:26 dinjas 1,5161321 javascript 2.7 sdk it is deprected –Kamal Kumar Aug 1 '16 at 6:35 add a comment up vote 16 down vote Though this post has been here for quite a while, the solutions are not pure JS. ProductsFacebook LoginSharing on FacebookGamesFacebook App Ads. ToolsGraph API ExplorerOpen Graph DebuggerObject BrowserJavaScript Test ConsoleAPI Upgrade ToolFacebook Analytics. My helper using PHP SDK: function isFan(){ global $facebook; $request = $facebook->getSignedRequest(); return $request['page']['liked']; } shareimprove this answer edited Jun 4 '11 at 15:50 answered Jun 4 '11 at 15:21 Tom Roggero 3,51411323 add a comment up vote 17 down vote You can do it in JavaScript like so (Building off of dwarfy's response to a similar question): div#containernotlike, div#containerlike { display: none; } window.fbAsyncInit = function() { FB.init({ appId : 'YOURAPPID', // App ID channelUrl : 'http(s)://YOURAPPDOMAIN/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); FB.getLoginStatus(function(response) { var pageid = "YOURPAGEID"; if (response && response.authResponse) { var userid = response.authResponse.userID; var fqlquery = "SELECT uid FROM pagefan WHERE pageid = "+pageid+"and uid="+userid; FB.Data.query(fqlquery).wait(function(rows) { if (rows.length == 1 && rows[0].uid == userid) { console.log("LIKE"); $('#containerlike').show(); } else { console.log("NO LIKEY"); $('#containernotlike').show(); } }); } else { FB.login(function(response) { if (response && response.authResponse) { var userid = response.authResponse.userID; var fqlquery = "SELECT uid FROM pagefan WHERE pageid = "+pageid+"and uid="+userid; FB.Data.query(fqlquery).wait(function(rows) { if (rows.length == 1 && rows[0].uid == userid) { console.log("LIKE"); $('#containerlike').show(); } else { console.log("NO LIKEY"); $('#containernotlike').show(); } }); } else { console.log("NO LIKEY"); $('#containernotlike').show(); } }, {scope: 'userlikes'}); } }); }; // Load the SDK Asynchronously (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/enUS/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); YOU DON'T LIKE ME Sad YOU LIKE ME Smile Where the channel.html file on your server just contains the line: There is a little code duplication in there, but you get the idea. in this way you dont need to ask for permissions to know if some one press the like button, but if you whant to know who press it, permissions are needed. shareimprove this answer answered Jan 16 '11 at 3:49 user210504 90921134 add a comment up vote 0 down vote Try using FQL. On subsequent visits nothing should pop up though. Stack Overflow Questions Developer Jobs Tags Users current community help chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. FB.api({ method: "pages.isFan", pageid: mypageid, }, function(response) { console.log(response); if(response){ alert('You Likey'); } else { alert('You not Likey Sad'); } } ); This returns: False But I'm a fan of my page so shouldn't it return true?! javascript facebook facebook-graph-api shareimprove this question edited Sep 21 '12 at 18:19 Igy 41k776109 asked Feb 23 '11 at 16:01 Patrik 1,16821840 1 possible duplicate of What's method for checking user fan of a page in GRAPH API? –ifaour Feb 23 '11 at 19:31 add a comment 5 Answers 5 active oldest votes up vote 96 down vote accepted I tore my hair out over this one too 5a02188284
oauth login for linkedin facebook google and microsoftfacebook gtd appwhat is the code for a music note on facebookfacebook hacker app.jardownload manager for facebookfacebook application for 5130 nokiacool facebook keyboard tricksverify facebook account mobile numberfacebook chat xcodefacebook credits gift cards australia


Revenir en haut
Publicité






MessagePosté le: Mar 9 Jan - 23:50 (2018)    Sujet du message: Publicité

PublicitéSupprimer les publicités ?
Revenir en haut
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet    TERA Callida - Cercle des Vanarchs Index du Forum -> ACCUEIL -> Requêtes et propositions Toutes les heures sont au format GMT + 2 Heures
Page 1 sur 1

 
Sauter vers:  

Index | Panneau d’administration | créer forum | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation
Powered by phpBB © 2001, 2005 phpBB Group
Traduction par : phpBB-fr.com