PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, March 6, 2022

[FIXED] Publish on Facebook to a app user with out login?

 March 06, 2022     facebook, facebook-graph-api, facebook-php-sdk     No comments   

Issue

I've read a lot and this is the only solution I get to:

  1. The first time the user logs in the app (with publish-actions) you get the token
  2. Convert the token to Long-Lived Token
  3. You can use it to publish for the next 2 months
  4. If the user clicks on a post you send, the token is reset to another 2 months

Am I right? Is that the best solution?


Solution

all correct. I am not sure about the user click (didn't find that in the documentation https://developers.facebook.com/docs/facebook-login/access-tokens). You should be ready to handle errors in case the token expires earlier or in case of app uninstalls. I check if the token is still valid by getting the user basic info with the access token I have. If the call is successful, I use the token. If not, I redirect the user app authorization again, get another token, exchange it with another long-lived token, and use that one.



Answered By - tattvamasi
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing