I
I
int02h2012-06-01 14:16:21
Programming
int02h, 2012-06-01 14:16:21

How to properly organize work with the VKontakte API in the Standalone application?

Hello, dear Habra community!
As part of my own training, I decided to make a simple Android application using the VKontakte API. And I have a few questions.
1. How to properly organize work with access token? After all, it has a lifetime (expires in), that is, while my application is running, this time may end and then I will not be able to make API calls. What to do in this case? Throw the user to the authorization page?
2. Is it correct to request an access token with "Offline" access rights? After all, this can confuse the user, and it will not solve the first problem, because the user can at any time cancel permissions for the application on his VKontakte page.
Thanks for the answer!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2012-06-01
@sergiks

I request rights, including offline, and I get a token with expires_in=0, i.e. Duncan Maclout is like that.

N
newonder, 2012-06-01
@newonder

If I understood the documentation correctly, then offline is used only for servers. In my iOS applications, I ask the user to enter a login / password if the token is invalidated. If cookies are stored, then the process is transparent to the user, since the request for the authentication form immediately returns a new token.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question