php-snapchat icon indicating copy to clipboard operation
php-snapchat copied to clipboard

Detecting if users has logged into Snapchat app

Open martynball opened this issue 10 years ago • 2 comments

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?

martynball avatar Jul 17 '14 09:07 martynball

I have made one function on snapchat.php :

public function isLogged() { $cache = $this->getUpdates();

return ($cache AND $cache->logged == true) ? true : false;

}

Grandnainconnu avatar Jul 18 '14 18:07 Grandnainconnu

This is a duplicate of #16.

gabrielsoldani avatar Jul 20 '14 09:07 gabrielsoldani