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

@shm-open/react-native-wechat

v1.3.0

Published

react-native library for wechat app

Downloads

34

Readme

react-native-wechat Node.js CI

[React Native] bridging library that integrates WeChat SDKs

本库是在 react-native-wechat 基础上进行重写; 优化了类型定义,方法调用,并且使用CocoaPodsgradle来管理原生模块依赖的wechat SDK.

Table of Contents

Getting Started

$ npm install @shm-open/react-native-wechat

API Documentation

[react-native-wechat] uses Promises, therefore you can use Promise or async/await to manage your dataflow.

registerApp(appId, universalLink)

  • appId {String} the appId you get from WeChat dashboard
  • universalLink {String} the iOS universalLink setting
  • returns {Boolean} explains if your application is registered done

This method should be called once globally.

import * as WeChat from 'react-native-wechat';

WeChat.registerApp('your wxid', 'your universal setting');

isWXAppInstalled()

  • returns {Boolean} if WeChat is installed.

Check if the WeChat app is installed on the device.

isWXAppSupportApi()

  • returns {Boolean} Contains the result.

Check if wechat support open url.

getApiVersion()

  • returns {String} Contains the result.

Get the WeChat SDK api version.

openWXApp()

  • returns {Boolean}

Open the WeChat app from your application.

sendAuthRequest(scope, state)

  • scope {String} Scopes of auth request. snsapi_userinfo or snsapi_base
  • state {String} 用于保持请求和回调的状态,授权请求后原样带回给第三方
  • returns {Object}

Send authentication request, and it returns an object with the following fields:

| field | type | description | | ------- | ------ | ----------------------------------- | | errCode | Number | Error Code | | errStr | String | Error message if any error occurred | | code | String | Authorization code | | state | String | state_wx_login |

pay(payload)

  • partnerId {String} 商家向财付通申请的商家 id
  • prepayId {String} 预支付订单 ID
  • nonceStr {String} 随机串,防重发
  • timeStamp {String} 时间戳,防重发
  • package {String} 商家根据财付通文档填写的数据和签名
  • sign {String} 商家根据微信开放平台文档对数据做的签名
  • returns {Object}

Sends request for proceeding payment, then returns an object:

| name | type | description | | ------- | ------ | ----------------------------------- | | errCode | Number | 0 if pay successed | | errStr | String | Error message if any error occurred |

Installation

$ npm install react-native-wechat --save

License

MIT