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

@cross2d/react-native-ushare

v1.1.3

Published

umeng share library for react-native

Downloads

17

Readme

react-native-ushare-kerison

基于友盟的分享做react-native分享组件封装

【注】:由于react-native-ushare提交不了,但是npmjs又搜不到,不知道是不是有人发布了私有的库,所以安装的时候注意是react-native-ushare-kerison,引用的时候

分享支持:

  • QQ
  • QQ空间
  • 微信
  • 朋友圈
  • 新浪微博

授权支持:

  • QQ
  • 微信
  • 新浪

使用

  1. 安装
npm i react-native-ushare-kerison
  1. 引入
import UShare from 'react-native-ushare-kerison';
  1. 分享
UShare.share(shareType,title,desc,image,url,(result)=>{
  if(result === UShare.SUCCESS){
    alert('分享成功!');
  }else if(result == UShare.CANCEL){
    alert('分享取消!');
  }else if(result === UShare.FAILED){
    alert('分享失败!');
  }
});
  1. 授权
UShare.authAndGetInfo(shareType,(result,data)=>{
  if(result === UShare.SUCCESS){
    console.log(data);
  }else if(result == UShare.CANCEL){
    alert('授权取消!');
  }else if(result === UShare.FAILED){
    alert('授权失败!');
  }
});

对应关系

  • 平台的类型都是大写,推荐使用UShare中的常量

  • QQ QQ

  • QZONE QQ空间

  • WEIXIN 微信

  • WEIXIN_CIRCLE 朋友圈

  • SINA 新浪微博

  • 返回值 推荐使用常量 (iOS中取消也认为是失败)

  • -1 失败 FAILED

  • 0 取消 CANCEL

  • 1 成功 SUCCESS

  • 授权的结果保留了公共的基本信息

  • name 昵称

  • gender 性别

  • icon 用户头像

  • uid QQ、Sina (微信的unionid)

  • openid 微信