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

@byron-react-native/wechat

v1.0.4

Published

React Native Wechat

Downloads

9

Readme

react-native-wechat

*暂时还有部分方法没完善

Getting started

$ yarn add @byron-react-native/wechat

iOS

// (1)配置URL Scheme
<>在XCode中,选择你的工程设置项,选中“TARGETS”一栏,在“info”标签栏的“URL type”
添加一条新的“URL scheme”,新的scheme = wxappid。如果您使用的是XCode3或者更低的版本,
则需要在plist文件中添加。</>

// (2)配置LSApplicationQueriesSchemes
<key>LSApplicationQueriesSchemes</key>
	<array>
    <string>weixin</string>
    <string>weixinULAPI</string>
  </array>

// (3)AppDelegate.mm 添加
#import "WXApiManager.h" 
#import "QQApiManager.h" // 如果有集成qq

// weixin qq
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  // 如果有集成qq
  if ([TencentOAuth CanHandleOpenURL:url]) {
    return [TencentOAuth HandleOpenURL:url];
  }
  return [WXApi handleOpenURL:url delegate:[WXApiManager sharedManager]]; 
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler
{
  // 如果有集成qq
  if ([TencentOAuth CanHandleUniversalLink:userActivity.webpageURL]) {
    return [TencentOAuth HandleUniversalLink:userActivity.webpageURL];
  }
  return [WXApi handleOpenUniversalLink:userActivity delegate:[WXApiManager sharedManager]];
}

Android

// app/build.gradle add
implementation "com.tencent.mm.opensdk:wechat-sdk-android:+"

// Create WXEntryActivity
import android.app.Activity;
import android.os.Bundle;

import com.byronwechat.WechatModule;

public class WXEntryActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        WechatModule.handleIntent(getIntent());
        finish();
    }
}

// AndroidManifest.xml add
<activity
    android:name=".wxapi.WXEntryActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Translucent.NoTitleBar"
    android:exported="true"
    android:taskAffinity="your package name"
    android:launchMode="singleTask">
</activity>

Api

/**
 * @brief WXApi的成员函数,向微信终端程序注册第三方应用
 * @attention 需要在每次启动第三方应用程序时调用
 * @param appid 微信开发者ID
 * @param universalLink 微信开发者Universal Link
 * @returns 成功返回YES,失败返回NO
 */
static registerApp(appid: string, universalLink: string): Promise<boolean>;
/**
 * @brief 检查微信是否已被用户安装
 * @returns 微信已安装返回YES,未安装返回NO
 */
static isWXAppInstalled(): Promise<boolean>;
/**
 * @brief 判断当前微信的版本是否支持OpenApi
 * @returns 支持返回YES,不支持返回NO
 */
static isWXAppSupportApi(): Promise<boolean>;
/**
 * @brief 获取微信的itunes安装地址
 * @returns 微信的安装地址字符串
 */
static getWXAppInstallUrl(): Promise<string>;
/**
 * @brief 获取当前微信SDK的版本号
 * @returns 返回当前微信SDK的版本号
 */
static getApiVersion(): Promise<string>;
/**
 * @brief 打开微信
 * @returns 成功返回YES,失败返回NO。
 */
static openWXApp(): Promise<boolean>;
/**
 * 第三方程序要向微信申请认证
 * @param scope 字符串长度不能超过1K
 * @param state 字符串长度不能超过1K
 * @param openID 字符串长度不能超过1K
 */
static sendAuth(
  scope: string,
  state: string,
  openID: string
): Promise<WXSendAuthResp | undefined>;
/**
 * 发送Text消息给微信
 * @param text 文本长度必须大于0且小于10K
 * @param scene 请求发送场景
 */
static sendText(
  text: string,
  scene: WXScene
): Promise<WXBaseResp | undefined>;
/**
 * 发送Photo消息给微信
 */
static sendImage(params: WXImageParams): Promise<WXBaseResp | undefined>;
/**
 * 发送Link消息给微信
 */
static sendLinkURL(
  params: WXLinkURLParams
): Promise<WXBaseResp | undefined>;
/**
 * 发送Music消息给微
 */
static sendMusicURL(
  params: WXMusicURLParams
): Promise<WXBaseResp | undefined>;
/**
 * 发送Video消息给微信
 */
static sendVideoURL(
  params: WXVideoURLParams
): Promise<WXBaseResp | undefined>;
/**
 * 订阅消息
 */
static subscription(
  scene: string,
  templateId: string,
  reserved: string,
  cb: (data: WXSubscribeMsgResp) => void
): Promise<{ remove: () => void } | undefined>;
/**
 * 跳转到微信客服会话
 */
static openCustomerService(
  corpId: string,
  url: string
): Promise<(WXBaseResp & { extMsg: string }) | undefined>;
static pay(params: Partial<WXPayParams>): Promise<boolean>;
static addListener(
  cb: (data: {
    extInfo: string;
    title: string;
    description: string;
  }) => void
): { remove: () => void };