Skip to content

7kgame/reactive-native-sns

Repository files navigation

react-native-sns

Getting started

$ npm install xxx --save

Mostly automatic installation

$ react-native link xxx

Usage

import * as LoginApi from 'react-native-sns';

QQ

LoginApi.qqLogin()
  .then(result => {
    /**
    * result = {
    *   code: 200,
    *   openid: xxx,
    *   access_token: xxx,
    *   expires_in: xxx
    * }
    */
    console.log('login qq result ', result.code);
  })
  .catch(err => {
    /**
    * err = {
    *   code: 101(qq登录异常) or 102(取消qq登录)
    *   msg: xxx
    * }
    */
    console.log('login qq err', err);
  })
  .catch(err => {
    /**
    * err: qq start fail
    */
    console.log('login qq fail', err);
  });

WeiXin

LoginApi.wxLogin()
  .then(result => {
    /**
    * result= {
    *   code: 200,
    *   wx_code: xxx
    * }
    */
    console.log('login weixin result=', result);
  })
  .catch(err => {
    /**
    * err = {
    *   code: 101,
    *   msg: "get weixin code failed"
    * }
    */
    console.log('login weixin err', err);
  });

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published