P
P
prosto_anton2016-01-07 14:10:59
Android
prosto_anton, 2016-01-07 14:10:59

How to use the VKSdk.login method correctly?

When using the VKSdk.login method, an empty authorization window opens on the smartphone. There is no information about either the application or the user, just the word "Authorization" in the title.
SDK initialization:

public class BaseApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        VKSdk.initialize(this);
    }
}

Method call:
public class HelloActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.hello);
        VKSdk.login(this, VKScope.WALL, VKScope.PHOTOS);
    }
}

In the manifest there is permission to work with the network:
<uses-permission android:name="android.permission.INTERNET"/>

The resources contain the correct application id: What did I forget or do wrong? PS: I shamanized with the application settings on vk.com (enabled / disabled, required / did not require installation, changed access rights), but this did not work. Also, an attempt to initialize the SDK manually using the VKSdk.customInitialize method did not work.
<integer name="com_vk_sdk_AppId">112233</integer>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Gapchenko, 2016-01-14
@artemgapchenko

Did you forget to include Activity from VK in the manifest?

<activity android:name="com.vk.sdk.VKOpenAuthActivity" />

<activity
    android:name="com.vk.sdk.VKServiceActivity"
    android:label="ServiceActivity"
    android:theme="@style/VK.Transparent" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question