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

react-native-sharesdk-wu

v1.0.25

Published

react-native集成share sdk第三方登录,分享。——微信

Downloads

3

Readme

react-native-sharesdk

share sdk for react-native

install

npm i react-native-sharesdk --save

link

react-native link react-native-sharesdk

IOS

qq 微信登录

  1. 打开Xcode app项目文件夹, 找到路径为node_modules/react-native-sharesdk/ios/rnsharesdk/ShareSDK的目录 并且拖动到Libraries目录,不要勾选'copy items if needed'。

  2. 在项目中找到"Build Settings"这一栏, 继续往下找到"Framework Search Paths" 这一节,加入以下这些路径值: $(SRCROOT)/../node_modules/react-native-sharesdk/ios/rnsharesdk/ShareSDK, $(SRCROOT)/../node_modules/react-native-sharesdk/ios/rnsharesdk/ShareSDK/Support/Optional, $(SRCROOT)/../node_modules/react-native-sharesdk/ios/rnsharesdk/ShareSDK/Support/PlatformConnector, $(SRCROOT)/../node_modules/react-native-sharesdk/ios/rnsharesdk/ShareSDK/Support/Required, $(SRCROOT)/../node_modules/react-native-sharesdk/ios/rnsharesdk/ShareSDK/Support/PlatformSDK/QQSDK, 继续找到"Library Search Paths" 这一节,加入以下这些路径值: $(SRCROOT)/../node_modules/react-native-sharesdk/ios/rnsharesdk/ShareSDK/Support/PlatformSDK/WeChatSDK,

3.在项目中找到"Build Phases"这一栏, 继续往下找到"Link Binary With Libraries"这一节,加入以下这些库: libicucore.tbd, libz.tbd, libstdc++.tbd, JavaScriptCore.framework, libsqlite3.tbd 具体依赖如下图

tbdimg

4.在项目中找到"Info"这一栏, 继续往下找到"URL Types"这一节,点击"+"号添加一栏数据,填入qq appid,微信app key 例如:tencent100371282, 100371282 是qq appid.

5.Under the "Info" tab of your project configuration, add LSApplicationQueriesSchemes of type Array For QQ SDK.

lsqschemesimg

items details from LSApplicationQueriesSchemes

6.specify your sharesdk appkey, qq appid and appkey in node_modules/react-native-sharesdk/ios/rnsharesdk/MobLogin.m

   [ShareSDK registerApp:@"iosv1101"
   onConfiguration:^(SSDKPlatformType platformType, NSMutableDictionary *appInfo) {
               
               switch (platformType)
               {
                   case SSDKPlatformTypeQQ:
                       [appInfo SSDKSetupQQByAppId:@"100371282"
                                            appKey:@"aed9b0303e3ed1e27bae87c33761161d"
                                          authType:SSDKAuthTypeBoth];
                       break;
                   default:
                       break;
               }
           }];

ANDROID

qq login

  1. specify your qq AppId in node_modules/react-native-sharesdk/android/build.gradle
defaultConfig {
      ...
      manifestPlaceholders = [
              QQ_APP_ID: "100371282", //qq AppId
      ]
  }
  1. specify your sharesdk appkey in node_modules/react-native-sharesdk/android/src/main/assets/ShareSDK.xml
<ShareSDK
      AppKey = "androidv1101"/> <!-- 修改成你在sharesdk后台注册的应用的appkey"-->
  1. specify your qq appid and appkey in node_modules/react-native-sharesdk/android/src/main/assets/ShareSDK.xml
<!-- ShareByAppClient标识是否使用微博客户端分享,默认是false -->
  <QQ
      Id="7"
      SortId="7"
      AppId="100371282"
      AppKey="aed9b0303e3ed1e27bae87c33761161d"
      ShareByAppClient="true"
      Enable="true" />

usage

...
import { NativeModules } from 'react-native'
const {MobLogin} = NativeModules

...
_onPressQQLogin() {
    MobLogin.loginWithQQ().then((data) => {
      console.log('token: ', data.token)
      console.log('user_id: ', data.user_id)
      console.log('user_name: ', data.user_name)
      console.log('user_gender: ', data.user_gender)
      console.log('user_icon: ', data.user_icon)
    }, (err) => {
      console.log(err)
    })
  }

  _onPressWeChatLogin() {
    MobLogin.loginWithWeChat().then((data) => {
      console.log('token: ', data.token)
      console.log('user_id: ', data.user_id)
      console.log('user_name: ', data.user_name)
      console.log('user_gender: ', data.user_gender)
      console.log('user_icon: ', data.user_icon)
    }, (err) => {
      console.log(err)
    })
  }

  _onPressShare() {
    MobLogin.showShare('我是标题', '分享什么内容')
  }

render() {
    return (
      <View style={styles.container}>
        <TouchableOpacity style={styles.qqlogin} onPress={()=>this._onPressLogin()}>
          <Text style={{fontSize: 18, color: 'black'}}>QQLogin</Text>
        </TouchableOpacity>
        ....
      </View>
    )
}