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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-wechat-api

v1.0.2

Published

A react-native wrapper for wechat api.

Downloads

10

Readme

react-native-wechat-api

A react-native wrapper for wechat API

install

npm i react-native-wechat-api --save

ios/RNWechatAPI.xcodeproj添加到项目中, link如下库:

D90D3626-3385-45E9-AAB7-ADF43257EE4B.png

项目引用

引用需要的文件头

在AppDelegate中加入以下代码:


#import "WXApi.h"
#import "WXApiManager.h"

要使你的程序启动后微信终端能响应你的程序,必须在代码中向微信终端注册你的id。

在AppDelegate 的 didFinishLaunchingWithOptions 函数中向微信注册id:


[WXApi registerApp:@"your id" withDescription:@"demo 2.0"];

重写AppDelegate的handleOpenURL和openURL方法:


- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
  return  [WXApi handleOpenURL:url delegate:[WXApiManager sharedManager]];
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [WXApi handleOpenURL:url delegate:[WXApiManager sharedManager]];
}

API

sendAuthReq(scope,state,openID)

此方法用于微信登陆认证, 相对应有个回调事件:


 constructor(props) {
        super(props);
        this.eventEmitter = NativeAppEventEmitter.addListener('didRecvAuthResponse', this._onAuthRes.bind(this));
    }


    componentWillUnmount() {
        this.eventEmitter.remove();
    }


    _onAuthRes(e) {
        console.log(e);
    }
    

FAQ

  • 目前只实现了登陆认证API, 其实其他API实现其实也很简单, 稍微改动一下代码就行, 但是目前感觉略坑的是, 分享API每次得需要一个image, 而js 调用oc目前我还没有找到一个好的模式去用这个分享API, 难道每次传一个url path? 当然如果你有更好的想法, 欢迎提交PR.