npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vovkasm/react-native-vkontakte-login

v1.1.1

Published

React Native wrapper for VK SDK Login

Downloads

7

Readme

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

Installation

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
	<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>vk</string>
		<string>vk-share</string>
		<string>vkauthorize</string>
	</array>
  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).

(TODO)

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:

	<key>VK_APP_ID</key>
	<integer>6658972</integer>

In this case you should not call initialize from JS.

Usage

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() {
  VKLogin.initialize(5514471);
}

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

const isLoggedIn = await VKLogin.isLoggedIn()
const auth = await VKLogin.login(['friends', 'photos', 'email'])
console.log(auth.access_token)
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.

Examples

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

Contributing

Feel free to submit pull requests