php-snapchat
php-snapchat copied to clipboard
Detecting if users has logged into Snapchat app
I have noticed that if you log into the Snapchat app, then try and use the username and auth_token with this API you can no longer get any snapchats as the app just made a new auth_token.
What would be the best way to detect that this has happened? If I do a check to see if any Snaps have been retrieved to see if the API auth_token is still valid I could get false results as there simply could be no new snaps.
Only way I can think of doing it is to see if the "cache" object in the Snapchat object has any contents as I noticed that it is empty if you login the app without logging back into the API.
Ideas?
I have made one function on snapchat.php :
public function isLogged() { $cache = $this->getUpdates();
return ($cache AND $cache->logged == true) ? true : false;
}
This is a duplicate of #16.