Closed martynball closed 10 years ago
You can also store the auth_token and username somewhere so you can use that to get the snaps later on without the need to sign in again.
How do I use the auth_token instead of using the $snapchat object?
That token confirms to Snapchat that it's an ongoing session...
I don't understand... when I login it creates an object called $snapchat, and then you use this object to get snaps, for example $snapchat->getSnaps();
But now if I was to navigate to another page that object is gone, unless I create it again using: $snapchat = new Snapchat('username', 'password');
So how would I use the auth_token to fetch snaps ect without the need of that object?
ive got it now after looking at the code! my bad!
$snapchat = new Snapchat('username', '' ,'auth_token');
This isn't really an issue with the API, but how would one go about keeping the use logged in throughout multiple pages? It creates an object when you login which is needed to fetch snaps, but if I pass that on using a session variable it messes the object up.
And I can't convert it to a array as the other functions like getSnaps() need it in object form! There are also sub-objects which mess up.
Anyone got any example code they would use to pass the object on or keep the user logged in? I want to use some Ajax to fetch recent snaps ect...