TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

React Native Vkontakte login (vovkasm's fork)

This module is a wrapper around native VK SDKs for Android and iOS.

It allows to log in to VK and obtain access token, which you can later use to make VK API calls.

Differences with origianl module

  • [x] Precompile all files, so module can be installed from git repo (no postinstall script)
  • [x] Remove all linking scripts (users supposed to make it by hands, sorry... I need control on my sources)
  • [x] Cleanup codebase
  • [x] Remote images can be shared


Prepare your application (iOS).

Follow Vkontakte iOS SDK documentation.

  1. Prepare for Using VK SDK
  2. Setup URL-schema of Your Application
  3. Add LSApplicationQueriesSchemes to Info.plist so SDK will allow to talk with Vkontakte application
  1. Implement application:openURL:options: in AppDelegate.m
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    BOOL ret = [VKSdk processOpenURL:url fromApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]];
    return ret;

Prepare your application (Android).


Install module

  1. Add this module to your js dependencies and istall it (npm install -P @vovkasm/react-native-vkontakte-login)
  2. (iOS) Add it to Podfile:
pod 'react-native-vkontakte-login', :path => '../node_modules/@vovkasm/react-native-vkontakte-login'

Run pod install Sorry, I don't support other linking methods for now. I'm using RN on iOS only with CocoaPods, it simplifies build infrastructure and reduces number of bugs.

SDK initialization

Also VKLogin have initialize method, I recommend do it authomatically (you have to modify Info.plist anyway). So place your app id to Info.plist:


In this case you should not call initialize from JS.


Import module in your JS code

import VKLogin from 'react-native-vkontakte-login'

Initialize VK with your APP ID once somewhere during your app startup:

componentDidMount() {

Check if user is logged in, perform login and logout:

const isLoggedIn = await VKLogin.isLoggedIn()
const auth = await VKLogin.login(['friends', 'photos', 'email'])
await VKLogin.logout()

The module also provides share method:

const shareResponse = await VKLogin.share({
  linkText: 'Cool site',
  linkUrl: 'https://news.ycombinator.com/',
  description: 'Check out this cool site!',
  image: TEST_IMAGE,

Check API Reference for more information.


Example project where this module is installed via Cocoapods: here Example project where this module is installed by modifying XCode project: here


Feel free to submit pull requests

Package Sidebar


npm i @vovkasm/react-native-vkontakte-login

Weekly Downloads






Unpacked Size

127 kB

Total Files


Last publish


  • vovkasm