Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
3686b32f27
Bump decode-uri-component from 0.2.0 to 0.2.2 in /playground
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-04 17:34:44 +00:00
167 changed files with 13152 additions and 52473 deletions

View File

@ -1,15 +0,0 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

3
.gitattributes vendored
View File

@ -1,3 +0,0 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf

View File

@ -1,27 +0,0 @@
name: Setup
description: Setup Node.js and install dependencies
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: |
yarn install --cwd example --frozen-lockfile
yarn install --frozen-lockfile
shell: bash

View File

@ -1,48 +0,0 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Lint files
run: yarn lint
- name: Typecheck files
run: yarn typecheck
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Build package
run: yarn prepack

74
.gitignore vendored
View File

@ -1,71 +1,19 @@
# OSX
#
.DS_Store
node_modules
/android/build
/android/RCTWeChat.iml
# XDE
.expo/
# VSCode
.vscode/
jsconfig.json
# ios
ios/build
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
DerivedData/
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
Pods/
*.xcuserstate
project.xcworkspace
# Android/IJ
#
.classpath
.cxx
.gradle
*.ipa
*.dSYM.zip
*.dSYM
.idea
.project
.settings
local.properties
android.iml
# Cocoapods
#
example/ios/Pods
# Ruby
example/vendor/
# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
# Expo
.expo/
# Turborepo
.turbo/
# generated by bob
lib/
android/.gradle

7
.npmignore Normal file
View File

@ -0,0 +1,7 @@
node_modules
/android/build
/android/RCTWeChat.iml
Example
*.jpg

1
.nvmrc
View File

@ -1 +0,0 @@
16.18.1

5
.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"singleQuote": true,
"printWidth": 100,
"trailingComma": "all"
}

38
.travis.yml Normal file
View File

@ -0,0 +1,38 @@
language: node_js
node_js:
- "7.1"
sudo: false
cache:
directories:
- $HOME/.yarn-cache
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
env:
- NODE_ENV='test'
install:
- npm install
script:
- npm test
matrix:
include:
- language: android
os: linux
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
node_js: false
- nvm install 7
android:
components:
- android-23
- build-tools-23.0.1
- language: objective-c
os: osx
osx_image: xcode8.2
node_js: false
xcode_project: ios/RCTWeChat.xcodeproj
xcode_scheme: ios/RCTWeChat
script:
- cd ios
- xcodebuild -scheme RCTWeChat -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty

View File

@ -1,3 +0,0 @@
# Override Yarn command so we can automatically setup the repo on running `yarn`
yarn-path "scripts/bootstrap.js"

View File

@ -1,133 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
Examples of behavior that contributes to creating a positive environment include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior include:
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
## Our Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at fox@sfxh.cc. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@ -1,114 +0,0 @@
# Contributing
Contributions are always welcome, no matter how large or small!
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md).
## Development workflow
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
```sh
yarn
```
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
To start the packager:
```sh
yarn example start
```
To run the example app on Android:
```sh
yarn example android
```
To run the example app on iOS:
```sh
yarn example ios
```
Make sure your code passes TypeScript and ESLint. Run the following to verify:
```sh
yarn typecheck
yarn lint
```
To fix formatting errors, run the following:
```sh
yarn lint --fix
```
Remember to add tests for your change if possible. Run the unit tests by:
```sh
yarn test
```
To edit the Objective-C or Swift files, open `example/ios/WechatLibExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-wechat-lib`.
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-wechat-lib` under `Android`.
### Commit message convention
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
- `feat`: new features, e.g. add new method to the module.
- `refactor`: code refactor, e.g. migrate from class components to hooks.
- `docs`: changes into documentation, e.g. add usage example for the module..
- `test`: adding or updating tests, e.g. add integration tests using detox.
- `chore`: tooling changes, e.g. change CI config.
Our pre-commit hooks verify that your commit message matches this format when committing.
### Linting and tests
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
Our pre-commit hooks verify that the linter and tests pass when committing.
### Publishing to npm
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
To publish new versions, run the following:
```sh
yarn release
```
### Scripts
The `package.json` file contains various scripts for common tasks:
- `yarn bootstrap`: setup project by installing all dependencies and pods.
- `yarn typecheck`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn test`: run unit tests with Jest.
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.
### Sending a pull request
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Verify that linters and tests are passing.
- Review the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.

View File

@ -1,6 +1,7 @@
MIT License
Copyright (c) 2022 little-snow-fox
Copyright (c) 2019 little-snow-fox
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights

30
RCTWeChat.podspec Normal file
View File

@ -0,0 +1,30 @@
#
# Be sure to run `pod spec lint RCTWeChat.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "RCTWeChat"
s.version = package['version']
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment"
s.description = <<-DESC
React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment
DESC
s.author = { "little-snow-fox" => "fox@sfxh.cc" }
s.homepage = "https://github.com/little-snow-fox/react-native-wechat-lib"
s.license = "MIT"
s.platform = :ios, "9.0"
s.source = { :git => "https://github.com/little-snow-fox/react-native-wechat-lib.git", :tag => "master" }
s.source_files = "ios/*.{h,m}"
s.dependency "React-Core"
s.vendored_libraries = "ios/libWeChatSDK.a"
s.requires_arc = true
s.frameworks = 'SystemConfiguration','CoreTelephony','WebKit'
s.library = 'sqlite3','c++','z'
end

122
README.md
View File

@ -1,54 +1,26 @@
<img height="200" src="./image/weixin.png?raw=true">
<img height="200" src="./weixin.png?raw=true">
# React-Native-Wechat-Lib
![Version](https://img.shields.io/badge/Version-V3.0.0-brightgreen)
![npm version](https://img.shields.io/badge/npm-v1.1.24-blue)
![Wechat SDK](https://img.shields.io/badge/WechatSDKAndroid-V6.8.20-brightgreen)
![Wechat SDK](https://img.shields.io/badge/WechatSDKIos-V2.0-brightgreen)
![react version](https://img.shields.io/badge/react-v70-blue)
本库为 react-native 项目提供 Wechat SDK 支持
[React Native] bridging library that integrates WeChat SDKs:
- Android SDK 6.8.20
- iOS SDK 2.0
- [x] iOS SDK 1.8.7.1
- [x] Android SDK 5.5.6
<br>
## 前言
## 路线图
- 3.0.x
- [X] React native 70
- [X] Android SDK 6.8.20
- [X] iOS SDK 2.0
- [ ] iOS SDK 2.0 No payment function
- [X] Example
- 1.1.x
- [X] React native 60
- [X] Android SDK 5.5.6
- [X] iOS SDK 1.8.7.1
- [X] iOS SDK 1.8.7.1 No payment function
首先向各位声明,本库是在 [react-native-wechat](https://github.com/yorkie/react-native-wechat) 基础上进行重写。
<br>
本库已经向 react-native-wechat 提交合并请求[#526](https://github.com/yorkie/react-native-wechat/pull/526),但由于 react-native-wechat 所使用的 WeChat SDK 已经是几年前的版本,新 SDK 接口变动大,我修改的代码相当多,几乎重构了核心部分,导致合并需要耗费不小时间,再加上需要兼容正在使用旧版 SDK 的开发者,事情变得异常艰辛。
## 注意
如果你的 IOS 应用需要使用**不带支付功能**的 WeChat SDK请使用带有 “-notpay” 后缀的 NPM 包。
考虑到自身使用和其它开发者的需要,最终决定开一个新仓库,提供给新项目使用。
目前最新代码版本为 3.0.x但 NPM Last 版本暂时只到 1.1.26,因为 **3.0.x 暂时还处于开发阶段**,有小部分功能**未经过测试**。
如果你需要使用 3.0.x 版本,请在 package.json 中加上版本号 react-native-wechat-lib@3.0.4,切换前请你清楚了解该版本的风险,该版本为开发版。
我会尽快推出 3.0.x 发行版。
<br>
最后,感谢 [yorkie](https://github.com/yorkie) 和各位开发者为 react-native-wechat 做出的贡献。
## 附言
本库由 [little-snow-fox](https://github.com/little-snow-fox) 发起。
希望各位大佬积极提交 PR单靠我一个人维护工作量大。
<br>
如果你的 IOS 应用需要使用**不带支付功能**的 WeChat SDK请使用带有 “-notpay” 后缀的 NPM 包。
If you need to use the WeChat SDK without payment for your IOS version, use the NPM package with the suffix "-notpay".
## 目录
@ -56,41 +28,17 @@
- [起步](#起步)
- [API 文档](#API文档)
<br>
## 安装
NPM 安装
```sh
npm install react-native-wechat-lib --save
# 3.0.0 开始弃用
react-native link react-native-wechat-lib
```
源码安装
```sh
git clone https://github.com/little-snow-fox/react-native-wechat-lib
cd react-native-wechat-lib
npm link
cd ../my-project
npm link react-native-wechat-lib
```
源码安装指定版本
```sh
git clone https://github.com/little-snow-fox/react-native-wechat-lib
cd react-native-wechat-lib
git checkout 1.1.x
npm link
cd ../my-project
npm link react-native-wechat-lib
```
<br>
## 起步
- [iOS 安装](./docs/build-setup-ios.md)
- [Android 安装](./docs/build-setup-android.md)
- [样例工程](./example)
<br>
## API 文档
@ -154,36 +102,6 @@ following fields:
| lang | String | The user language |
| country | String | The user country |
#### authByScan([scope, nonceStr, onQRGet]) 微信扫码授权登录
- `appId` {String} the appId you get from WeChat dashboard
- `appSecret` {String} the appSecret you get from WeChat dashboard
- `onQRGet` (String) => void
调用 authByScan 后,需要监听二维码的获取,展示完二维码,用户扫码登录完成后才会回调 callback字段如下
| field | type | description |
| ------- | ------ | ----------------------------------- |
| errCode | Number | Error Code |
| errStr | String | Error message if any error occurred |
| nickname | String | 微信昵称 |
| headimgurl | String | 微信头像链接 |
| openid | String | openid |
| unionid | String | unionid |
示例如下
```js
const ret = await WeChat.authByScan(WeiXinId, WeiXinSecret, (qrcode) => {
console.log(qrcode)
// 拿到 qrcode 用 Image 去渲染
});
console.log('登录信息', ret);
```
如有不懂,可以查看[微信官方文档](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Login/Login_via_Scan.html)
#### ShareText(ShareTextMetadata) 分享文本
ShareTextMetadata
@ -256,7 +174,7 @@ ShareFileMetadata
| name | type | description |
| ----- | ------ | -------------- |
| url | String | 文件地址。如果是远程文件,则为 http 开头;如果是本地文件,则为绝对路径,如 /storage/emulated/0/Android/xxx |
| url | String | 文件地址 |
| title | String | 文件标题 |
| scene | Number | 分享到, 0:会话 |
@ -267,9 +185,6 @@ Return:
| errCode | Number | 0 if authorization succeed |
| errStr | String | Error message if any error occurred |
安卓实现分享本地文件需要对工程进行一些配置,详见 [Android 安装](./docs/build-setup-android.md#分享本地文件)
```js
import * as WeChat from 'react-native-wechat-lib';
@ -527,19 +442,6 @@ Sends request for proceeding payment, then returns an object:
});
```
<br>
## License
MIT
Author: [little-snow-fox](https://github.com/little-snow-fox/react-native-wechat-lib)
<br>
## Sponsor
如果觉得本库还行,你愿意的话可以请我喝咖啡 ^_^ 。
<img src="./image/wepay.jpg" alt="wepay" width="380" />
<img src="./image/alipay.jpg" alt="alipay" width="380" />

1
_config.yml Normal file
View File

@ -0,0 +1 @@
theme: jekyll-theme-merlot

18
android/android.iml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" />
<option name="LAST_KNOWN_AGP_VERSION" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,75 +1,33 @@
buildscript {
repositories {
google()
mavenCentral()
}
apply plugin: 'com.android.library'
dependencies {
classpath "com.android.tools.build:gradle:7.2.1"
}
}
def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}
apply plugin: "com.android.library"
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["WechatLib_" + name]
}
def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["WechatLib_" + name]).toInteger()
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
compileSdkVersion safeExtGet('compileSdkVersion', 23)
buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1')
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
}
buildTypes {
release {
minifyEnabled false
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 22)
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
lintOptions {
disable "GradleCompatible"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral()
google()
allprojects {
repositories {
jcenter()
maven { url "$projectDir/../../react-native/android" }
}
}
dependencies {
// For < 0.71, this will be from the local maven repo
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native"
api group: 'com.tencent.mm.opensdk', name: 'wechat-sdk-android', version: '6.8.20'
}
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
libraryName = "WechatLib"
codegenJavaPackageName = "com.wechatlib"
}
api 'com.facebook.react:react-native:+'
api files('libs/libammsdk.jar')
// compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
}

View File

@ -1,5 +0,0 @@
WechatLib_kotlinVersion=1.7.0
WechatLib_minSdkVersion=21
WechatLib_targetSdkVersion=31
WechatLib_compileSdkVersion=31
WechatLib_ndkversion=21.4.7075529

Binary file not shown.

View File

@ -1,5 +1,6 @@
#Mon Nov 16 15:28:05 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

286
android/gradlew vendored Executable file → Normal file
View File

@ -1,129 +1,78 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#!/usr/bin/env sh
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
MAX_FD="maximum"
warn () {
echo "$*"
} >&2
}
die () {
echo
echo "$*"
echo
exit 1
} >&2
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD=$JAVA_HOME/bin/java
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -132,7 +81,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@ -140,95 +89,84 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

173
android/gradlew.bat vendored
View File

@ -1,89 +1,84 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

BIN
android/libs/libammsdk.jar Normal file

Binary file not shown.

8
android/local.properties Normal file
View File

@ -0,0 +1,8 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Nov 16 15:27:54 CST 2020
sdk.dir=/Users/snowfox/Library/Android/sdk

View File

@ -1,12 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wechatlib">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<queries>
<package android:name="com.tencent.mm" />
</queries>
package="com.theweflex.react">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>

View File

@ -1,4 +1,4 @@
package com.wechatlib;
package com.theweflex.react;
import android.content.Context;
import android.content.Intent;
@ -6,10 +6,8 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Environment;
import android.util.Base64;
import androidx.annotation.Nullable;
import androidx.core.content.FileProvider;
import com.facebook.common.executors.UiThreadImmediateExecutorService;
import com.facebook.common.internal.Files;
@ -26,21 +24,14 @@ import com.facebook.imagepipeline.request.ImageRequestBuilder;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.modules.core.RCTNativeAppEventEmitter;
import com.tencent.mm.opensdk.diffdev.DiffDevOAuthFactory;
import com.tencent.mm.opensdk.diffdev.IDiffDevOAuth;
import com.tencent.mm.opensdk.diffdev.OAuthErrCode;
import com.tencent.mm.opensdk.diffdev.OAuthListener;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.modelbiz.ChooseCardFromWXCardPackage;
import com.tencent.mm.opensdk.modelbiz.WXOpenCustomerServiceChat;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.modelmsg.SendMessageToWX;
import com.tencent.mm.opensdk.modelmsg.ShowMessageFromWX;
@ -76,7 +67,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.UUID;
public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAPIEventHandler {
public class WeChatModule extends ReactContextBaseJavaModule implements IWXAPIEventHandler {
private String appId;
private IWXAPI api = null;
@ -114,7 +105,7 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
return baos.toByteArray();
}
public WeChatLibModule(ReactApplicationContext context) {
public WeChatModule(ReactApplicationContext context) {
super(context);
}
@ -124,8 +115,8 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
}
/**
* fix Native module WeChatLibModule tried to override WeChatLibModule for module name RCTWeChat.
* If this was your intention, return true from WeChatLibModule#canOverrideExistingModule() bug
* fix Native module WeChatModule tried to override WeChatModule for module name RCTWeChat.
* If this was your intention, return true from WeChatModule#canOverrideExistingModule() bug
*
* @return
*/
@ -133,7 +124,7 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
return true;
}
private static ArrayList<WeChatLibModule> modules = new ArrayList<>();
private static ArrayList<WeChatModule> modules = new ArrayList<>();
@Override
public void initialize() {
@ -151,47 +142,11 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
}
public static void handleIntent(Intent intent) {
for (WeChatLibModule mod : modules) {
for (WeChatModule mod : modules) {
mod.api.handleIntent(intent, mod);
}
}
private void sendEvent(ReactContext reactContext, String eventName, WritableMap params) {
reactContext.getJSModule(RCTNativeAppEventEmitter.class).emit(eventName, params);
}
@ReactMethod
public void authByScan(String appid, String nonceStr, String timeStamp, String scope, String signature, String schemeData, final Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
IDiffDevOAuth oauth = DiffDevOAuthFactory.getDiffDevOAuth();
oauth.stopAuth();
oauth.auth(appid, scope, nonceStr, timeStamp, signature, new OAuthListener() {
@Override
public void onAuthGotQrcode(String var1, byte[] var2){
WritableMap map = Arguments.createMap();
String base64String = Base64.encodeToString(var2, Base64.DEFAULT);
map.putString("qrcode", base64String);
sendEvent(getReactApplicationContext(), "onAuthGotQrcode", map);
}
@Override
public void onQrcodeScanned() {
}
@Override
public void onAuthFinish(OAuthErrCode var1, String var2){
WritableMap map = Arguments.createMap();
map.putString("authCode", var2);
map.putInt("errCode", var1.getCode());
callback.invoke(null, map);
}
});
}
@ReactMethod
public void registerApp(String appid, String universalLink, Callback callback) {
this.appId = appid;
@ -299,21 +254,6 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
return data;
}
public String getFileUri(Context context, File file) {
if (file == null || !file.exists()) {
return null;
}
Uri contentUri = FileProvider.getUriForFile(context,
context.getPackageName() + ".fileprovider", // 要与`AndroidManifest.xml`里配置的`authorities`一致
file);
// 授权给微信访问路径
context.grantUriPermission("com.tencent.mm", // 这里填微信包名
contentUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
return contentUri.toString(); // contentUri.toString() 即是以"content://"开头的用于共享的路径
}
/**
* 分享文本
@ -324,15 +264,7 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
@ReactMethod
public void shareFile(ReadableMap data, Callback callback) throws Exception {
WXFileObject fileObj = new WXFileObject();
String url = data.getString("url");
if (url.startsWith("http")) {
fileObj.fileData = loadRawDataFromURL(url);
} else {
File file = new File(url);
String fileUri = getFileUri(getReactApplicationContext(), file);
fileObj.filePath = fileUri;
}
fileObj.fileData = loadRawDataFromURL(data.getString("url"));
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = fileObj;
@ -740,20 +672,6 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
callback.invoke(api.sendReq(payReq) ? null : INVOKE_FAILED);
}
@ReactMethod
public void openCustomerServiceChat(String corpId, String kfUrl, Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
// open customer service logic
WXOpenCustomerServiceChat.Req req = new WXOpenCustomerServiceChat.Req();
req.corpId = corpId;
req.url = kfUrl;
callback.invoke(null, api.sendReq(req));
}
private void _share(final int scene, final ReadableMap data, final Callback callback) {
Uri uri = null;
if (data.hasKey("thumbImage")) {
@ -774,7 +692,7 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
this._getImage(uri, new ResizeOptions(100, 100), new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bitmap) {
WeChatLibModule.this._share(scene, data, bitmap, callback);
WeChatModule.this._share(scene, data, bitmap, callback);
}
});
} else {
@ -855,7 +773,7 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
if (mediaObject == null) {
callback.invoke(INVALID_ARGUMENT);
} else {
WeChatLibModule.this._share(scene, data, thumbImage, mediaObject, callback);
WeChatModule.this._share(scene, data, thumbImage, mediaObject, callback);
}
}
});
@ -867,7 +785,7 @@ public class WeChatLibModule extends ReactContextBaseJavaModule implements IWXAP
if (mediaObject == null) {
callback.invoke(INVALID_ARGUMENT);
} else {
WeChatLibModule.this._share(scene, data, thumbImage, mediaObject, callback);
WeChatModule.this._share(scene, data, thumbImage, mediaObject, callback);
}
}
});

View File

@ -1,4 +1,4 @@
package com.wechatlib;
package com.theweflex.react;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
@ -10,12 +10,12 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class WeChatLibPackage implements ReactPackage {
public class WeChatPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.asList(new NativeModule[]{
// Modules from third-party
new WeChatLibModule(reactContext),
new WeChatModule(reactContext),
});
}

View File

@ -1,15 +1,10 @@
# Build Setup for Android
## 注意
请根据本文档严格配置,否则会导致微信无法回调你的应用,例如授权登录后无法跳回 APP或者小程序无法拉起 APP
如果配置过程有不明白,可以查看 [样本工程](https://github.com/little-snow-fox/react-native-wechat-lib/tree/master/example)
在样本工程里搜索 '**react-native-wechat-lib support**' 便可以找到所有需要添加配置的地方
Then update `MainActivity.java` or `MainApplication.java`:
## 注册模块
添加到 `MainApplication.java``MainActivity.java`:
```java
import com.wechatlib.WeChatLibPackage; // Add this line
import com.theweflex.react.WeChatPackage; // Add this line
@Override
protected List<ReactPackage> getPackages() {
@ -17,26 +12,29 @@ import com.wechatlib.WeChatLibPackage; // Add this line
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new WeChatLibPackage()); // Add this line
packages.add(new WeChatPackage()); // Add this line
return packages;
}
```
## 登录和分享回调
如果您打算集成登录或共享功能,则需要这样做
在应用程序包和类中创建名为 "wxapi" 的包, 命名为 WXEntryActivit
**Integrating with login and share**
If you are going to integrate login or share functions, you need to
create a package named 'wxapi' in your application package and a class
named `WXEntryActivity` in it.
```java
package your.package.wxapi;
import android.app.Activity;
import android.os.Bundle;
import com.wechatlib.WeChatLibModule;
import com.theweflex.react.WeChatModule;
public class WXEntryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WeChatLibModule.handleIntent(getIntent());
WeChatModule.handleIntent(getIntent());
finish();
}
}
@ -56,7 +54,7 @@ Then add the following node to `AndroidManifest.xml`:
</manifest>
```
## 支付回调
**Integrating the WeChat Payment**
If you are going to integrate payment functionality by using this library, then
create a package named also `wxapi` in your application package and a class named
@ -67,7 +65,7 @@ package your.package.wxapi;
import android.app.Activity;
import android.os.Bundle;
import com.wechatlib;
import com.theweflex.react.WeChatModule;
public class WXPayEntryActivity extends Activity {
@Override
@ -98,7 +96,7 @@ Then add the following node to `AndroidManifest.xml`:
android:taskAffinity="your packagename"
android:launchMode="singleTask"
```
保证跳转后回到你的app的task。
保证跳转后回到你的app的task。
实际上,我的代码如下:
```xml
<manifest>
@ -113,54 +111,3 @@ android:launchMode="singleTask"
</application>
</manifest>
```
## 分享本地文件
如果你需要分享本地文件,需要在 Android 的工程里进行一些设置,否则会有权限问题
步骤 1app/src/main/AndroidManifest.xml 中添加 provider 标签,其中 com.yourapp.xxx 要替换为你自己的包名,记得保留后面的 `.fileprovider`
```xml
<application ...>
...
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.yourapp.xxx.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
...
</application>
```
步骤 2实现 app/src/main/res/xml/filepaths.xml
```xml
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="myexternalimages" path="Download/" />
<cache-path name="my_cache_files" path="." />
<root-path name="root" path="" />
<files-path name="files-path" path="." />
</paths>
```
在这个 XML 文件中,你可以定义不同的路径类型(如 cache-path、external-path 等),以及对应的路径前缀。这样,在使用 FileProvider.getUriForFile() 时,就可以根据这些定义来获取正确的 URI。
请注意,当组件库被集成到不同的应用中时,你可能需要根据你自己的需求调整 filepaths.xml 中的路径定义。
## 关于 Android11
微信将于近期发布 targetSdkVersion 30的客户端版本因Android11系统特性该微信版本在Android 11及以上系统版本的设备上运行时授权登录、分享、微信支付等功能受到影响可能无法正常使用。为了适配 Android 系统新版本特性保证微信功能正常使用请第三方应用2021年11月1日之前进行更新
在自己 React Native 项目的 android/app/src/main/AndroidManifest.xml 中添加:
```$xml
<queries>
<!--
微信 Android 11-更新 openSDK 适配
参见 https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/Android.html#jump2
-->
<package android:name="com.tencent.mm" />
/queries>
```

View File

@ -91,7 +91,4 @@ Universal Links 配置文件, 没使用的话可以忽略。
@end
```
Mainly need to add '#import "WXApi.h"' and 'wxapidelegate'.
主要是需要加上 '#import "WXApi.h"' 和 'WXApiDelegate' 。
## 4. 从版本 3.0.0 开始,需要手动导入 libWeChatSDK.a 到 XCode
直接复制本项目的 /ios/libWeChatSDK.a 到 Xcode 项目根目录,详细可参考 example 工程
主要是需要加上 '#import "WXApi.h"' 和 'WXApiDelegate' 。

View File

@ -1,2 +0,0 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1

View File

@ -1 +0,0 @@
16

View File

@ -1 +0,0 @@
2.7.5

View File

@ -1 +0,0 @@
{}

View File

@ -1,6 +0,0 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

View File

@ -1,313 +0,0 @@
apply plugin: "com.android.application"
import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and that value will be read here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
/**
* Architectures to build native code for.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "pro.aili.temporary"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
if (isNewArchitectureEnabled()) {
// We configure the CMake build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
cmake {
arguments "-DPROJECT_BUILD_DIR=$buildDir",
"-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
"-DANDROID_STL=c++_shared"
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
ndk {
abiFilters (*reactNativeArchitectures())
}
}
}
}
if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
cmake {
path "$projectDir/src/main/jni/CMakeLists.txt"
}
}
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
afterEvaluate {
// If you wish to add a custom TurboModule or component locally,
// you should uncomment this line.
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
// Due to a bug inside AGP, we have to explicitly set a dependency
// between configureCMakeDebug* tasks and the preBuild tasks.
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
configureCMakeDebug.dependsOn(preDebugBuild)
reactNativeArchitectures().each { architecture ->
tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
dependsOn("preDebugBuild")
}
tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
dependsOn("preReleaseBuild")
}
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include (*reactNativeArchitectures())
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}
}
if (isNewArchitectureEnabled()) {
// If new architecture is enabled, we let you build RN from source
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
// This will be applied to all the imported transtitive dependency.
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid"))
.because("On New Architecture we're building React Native from source")
substitute(module("com.facebook.react:hermes-engine"))
.using(project(":ReactAndroid:hermes-engine"))
.because("On New Architecture we're building Hermes from source")
}
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set `newArchEnabled` to true inside the `gradle.properties` file
// - Invoke gradle with `-newArchEnabled=true`
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}

Binary file not shown.

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
</manifest>

View File

@ -1,73 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package pro.aili.temporary;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceEventListener;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}

View File

@ -1,48 +0,0 @@
package pro.aili.temporary;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "WechatLibExample";
}
/**
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
* (Paper).
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new MainActivityDelegate(this, getMainComponentName());
}
public static class MainActivityDelegate extends ReactActivityDelegate {
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
super(activity, mainComponentName);
}
@Override
protected ReactRootView createRootView() {
ReactRootView reactRootView = new ReactRootView(getContext());
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
return reactRootView;
}
@Override
protected boolean isConcurrentRootEnabled() {
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
}
}

View File

@ -1,98 +0,0 @@
package pro.aili.temporary;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.soloader.SoLoader;
import pro.aili.temporary.newarchitecture.MainApplicationReactNativeHost;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
// react-native-wechat-lib support (
import com.wechatlib.WeChatLibPackage;
// )
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// react-native-wechat-lib support (
// Packages that cannot be autolinked yet can be added manually here, for example:
packages.add(new WeChatLibPackage());
// )
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
private final ReactNativeHost mNewArchitectureNativeHost =
new MainApplicationReactNativeHost(this);
@Override
public ReactNativeHost getReactNativeHost() {
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
return mNewArchitectureNativeHost;
} else {
return mReactNativeHost;
}
}
@Override
public void onCreate() {
super.onCreate();
// If you opted-in for the New Architecture, we enable the TurboModule system
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("pro.aili.temporary.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}

View File

@ -1,116 +0,0 @@
package pro.aili.temporary.newarchitecture;
import android.app.Application;
import androidx.annotation.NonNull;
import com.facebook.react.PackageList;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.JSIModulePackage;
import com.facebook.react.bridge.JSIModuleProvider;
import com.facebook.react.bridge.JSIModuleSpec;
import com.facebook.react.bridge.JSIModuleType;
import com.facebook.react.bridge.JavaScriptContextHolder;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.react.fabric.CoreComponentsRegistry;
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.fabric.ReactNativeConfig;
import com.facebook.react.uimanager.ViewManagerRegistry;
import pro.aili.temporary.BuildConfig;
import pro.aili.temporary.newarchitecture.components.MainComponentsRegistry;
import pro.aili.temporary.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
import java.util.ArrayList;
import java.util.List;
/**
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
* TurboModule delegates and the Fabric Renderer.
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
public class MainApplicationReactNativeHost extends ReactNativeHost {
public MainApplicationReactNativeHost(Application application) {
super(application);
}
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
// packages.add(new TurboReactPackage() { ... });
// If you have custom Fabric Components, their ViewManagers should also be loaded here
// inside a ReactPackage.
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@NonNull
@Override
protected ReactPackageTurboModuleManagerDelegate.Builder
getReactPackageTurboModuleManagerDelegateBuilder() {
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
// for the new architecture and to use TurboModules correctly.
return new MainApplicationTurboModuleManagerDelegate.Builder();
}
@Override
protected JSIModulePackage getJSIModulePackage() {
return new JSIModulePackage() {
@Override
public List<JSIModuleSpec> getJSIModules(
final ReactApplicationContext reactApplicationContext,
final JavaScriptContextHolder jsContext) {
final List<JSIModuleSpec> specs = new ArrayList<>();
// Here we provide a new JSIModuleSpec that will be responsible of providing the
// custom Fabric Components.
specs.add(
new JSIModuleSpec() {
@Override
public JSIModuleType getJSIModuleType() {
return JSIModuleType.UIManager;
}
@Override
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
final ComponentFactory componentFactory = new ComponentFactory();
CoreComponentsRegistry.register(componentFactory);
// Here we register a Components Registry.
// The one that is generated with the template contains no components
// and just provides you the one from React Native core.
MainComponentsRegistry.register(componentFactory);
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
ViewManagerRegistry viewManagerRegistry =
new ViewManagerRegistry(
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
ReactNativeConfig.DEFAULT_CONFIG,
viewManagerRegistry);
}
});
return specs;
}
};
}
}

View File

@ -1,36 +0,0 @@
package pro.aili.temporary.newarchitecture.components;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.soloader.SoLoader;
/**
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
* folder for you).
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
@DoNotStrip
public class MainComponentsRegistry {
static {
SoLoader.loadLibrary("fabricjni");
}
@DoNotStrip private final HybridData mHybridData;
@DoNotStrip
private native HybridData initHybrid(ComponentFactory componentFactory);
@DoNotStrip
private MainComponentsRegistry(ComponentFactory componentFactory) {
mHybridData = initHybrid(componentFactory);
}
@DoNotStrip
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
return new MainComponentsRegistry(componentFactory);
}
}

View File

@ -1,48 +0,0 @@
package pro.aili.temporary.newarchitecture.modules;
import com.facebook.jni.HybridData;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.soloader.SoLoader;
import java.util.List;
/**
* Class responsible to load the TurboModules. This class has native methods and needs a
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
* folder for you).
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
public class MainApplicationTurboModuleManagerDelegate
extends ReactPackageTurboModuleManagerDelegate {
private static volatile boolean sIsSoLibraryLoaded;
protected MainApplicationTurboModuleManagerDelegate(
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
super(reactApplicationContext, packages);
}
protected native HybridData initHybrid();
native boolean canCreateTurboModule(String moduleName);
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
protected MainApplicationTurboModuleManagerDelegate build(
ReactApplicationContext context, List<ReactPackage> packages) {
return new MainApplicationTurboModuleManagerDelegate(context, packages);
}
}
@Override
protected synchronized void maybeLoadOtherSoLibraries() {
if (!sIsSoLibraryLoaded) {
// If you change the name of your application .so file in the Android.mk file,
// make sure you update the name here as well.
SoLoader.loadLibrary("wechatlibexample_appmodules");
sIsSoLibraryLoaded = true;
}
}
}

View File

@ -1,7 +0,0 @@
cmake_minimum_required(VERSION 3.13)
# Define the library name here.
project(wechatlibexample_appmodules)
# This file includes all the necessary to let you build your application with the New Architecture.
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)

View File

@ -1,32 +0,0 @@
#include "MainApplicationModuleProvider.h"
#include <rncli.h>
#include <rncore.h>
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string &moduleName,
const JavaTurboModule::InitParams &params) {
// Here you can provide your own module provider for TurboModules coming from
// either your application or from external libraries. The approach to follow
// is similar to the following (for a library called `samplelibrary`:
//
// auto module = samplelibrary_ModuleProvider(moduleName, params);
// if (module != nullptr) {
// return module;
// }
// return rncore_ModuleProvider(moduleName, params);
// Module providers autolinked by RN CLI
auto rncli_module = rncli_ModuleProvider(moduleName, params);
if (rncli_module != nullptr) {
return rncli_module;
}
return rncore_ModuleProvider(moduleName, params);
}
} // namespace react
} // namespace facebook

View File

@ -1,16 +0,0 @@
#pragma once
#include <memory>
#include <string>
#include <ReactCommon/JavaTurboModule.h>
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string &moduleName,
const JavaTurboModule::InitParams &params);
} // namespace react
} // namespace facebook

View File

@ -1,45 +0,0 @@
#include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainApplicationModuleProvider.h"
namespace facebook {
namespace react {
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
MainApplicationTurboModuleManagerDelegate::initHybrid(
jni::alias_ref<jhybridobject>) {
return makeCxxInstance();
}
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
registerHybrid({
makeNativeMethod(
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
makeNativeMethod(
"canCreateTurboModule",
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
});
}
std::shared_ptr<TurboModule>
MainApplicationTurboModuleManagerDelegate::getTurboModule(
const std::string &name,
const std::shared_ptr<CallInvoker> &jsInvoker) {
// Not implemented yet: provide pure-C++ NativeModules here.
return nullptr;
}
std::shared_ptr<TurboModule>
MainApplicationTurboModuleManagerDelegate::getTurboModule(
const std::string &name,
const JavaTurboModule::InitParams &params) {
return MainApplicationModuleProvider(name, params);
}
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
const std::string &name) {
return getTurboModule(name, nullptr) != nullptr ||
getTurboModule(name, {.moduleName = name}) != nullptr;
}
} // namespace react
} // namespace facebook

View File

@ -1,38 +0,0 @@
#include <memory>
#include <string>
#include <ReactCommon/TurboModuleManagerDelegate.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
class MainApplicationTurboModuleManagerDelegate
: public jni::HybridClass<
MainApplicationTurboModuleManagerDelegate,
TurboModuleManagerDelegate> {
public:
// Adapt it to the package you used for your Java class.
static constexpr auto kJavaDescriptor =
"Lcom/wechatlibexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
static void registerNatives();
std::shared_ptr<TurboModule> getTurboModule(
const std::string &name,
const std::shared_ptr<CallInvoker> &jsInvoker) override;
std::shared_ptr<TurboModule> getTurboModule(
const std::string &name,
const JavaTurboModule::InitParams &params) override;
/**
* Test-only method. Allows user to verify whether a TurboModule can be
* created by instances of this class.
*/
bool canCreateTurboModule(const std::string &name);
};
} // namespace react
} // namespace facebook

View File

@ -1,65 +0,0 @@
#include "MainComponentsRegistry.h"
#include <CoreComponentsRegistry.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/components/rncore/ComponentDescriptors.h>
#include <rncli.h>
namespace facebook {
namespace react {
MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
std::shared_ptr<ComponentDescriptorProviderRegistry const>
MainComponentsRegistry::sharedProviderRegistry() {
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
// Autolinked providers registered by RN CLI
rncli_registerProviders(providerRegistry);
// Custom Fabric Components go here. You can register custom
// components coming from your App or from 3rd party libraries here.
//
// providerRegistry->add(concreteComponentDescriptorProvider<
// AocViewerComponentDescriptor>());
return providerRegistry;
}
jni::local_ref<MainComponentsRegistry::jhybriddata>
MainComponentsRegistry::initHybrid(
jni::alias_ref<jclass>,
ComponentFactory *delegate) {
auto instance = makeCxxInstance(delegate);
auto buildRegistryFunction =
[](EventDispatcher::Weak const &eventDispatcher,
ContextContainer::Shared const &contextContainer)
-> ComponentDescriptorRegistry::Shared {
auto registry = MainComponentsRegistry::sharedProviderRegistry()
->createComponentDescriptorRegistry(
{eventDispatcher, contextContainer});
auto mutableRegistry =
std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
mutableRegistry->setFallbackComponentDescriptor(
std::make_shared<UnimplementedNativeViewComponentDescriptor>(
ComponentDescriptorParameters{
eventDispatcher, contextContainer, nullptr}));
return registry;
};
delegate->buildRegistryFunction = buildRegistryFunction;
return instance;
}
void MainComponentsRegistry::registerNatives() {
registerHybrid({
makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
});
}
} // namespace react
} // namespace facebook

View File

@ -1,32 +0,0 @@
#pragma once
#include <ComponentFactory.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
namespace facebook {
namespace react {
class MainComponentsRegistry
: public facebook::jni::HybridClass<MainComponentsRegistry> {
public:
// Adapt it to the package you used for your Java class.
constexpr static auto kJavaDescriptor =
"Lcom/wechatlibexample/newarchitecture/components/MainComponentsRegistry;";
static void registerNatives();
MainComponentsRegistry(ComponentFactory *delegate);
private:
static std::shared_ptr<ComponentDescriptorProviderRegistry const>
sharedProviderRegistry();
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
ComponentFactory *delegate);
};
} // namespace react
} // namespace facebook

View File

@ -1,11 +0,0 @@
#include <fbjni/fbjni.h>
#include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainComponentsRegistry.h"
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
return facebook::jni::initialize(vm, [] {
facebook::react::MainApplicationTurboModuleManagerDelegate::
registerNatives();
facebook::react::MainComponentsRegistry::registerNatives();
});
}

View File

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
<selector>
<!--
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
-->
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
</selector>
</inset>

View File

@ -1,3 +0,0 @@
<resources>
<string name="app_name">WechatLibExample</string>
</resources>

View File

@ -1,9 +0,0 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
</style>
</resources>

View File

@ -1,51 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}

View File

@ -1,40 +0,0 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.125.0
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false

View File

@ -1,234 +0,0 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View File

@ -1,11 +0,0 @@
rootProject.name = 'WechatLibExample'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}

View File

@ -1,4 +0,0 @@
{
"name": "WechatLibExample",
"displayName": "WechatLibExample"
}

View File

@ -1,17 +0,0 @@
const path = require('path');
const pak = require('../package.json');
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
extensions: ['.tsx', '.ts', '.js', '.json'],
alias: {
[pak.name]: path.join(__dirname, '..', pak.source),
},
},
],
],
};

View File

@ -1,11 +0,0 @@
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)

View File

@ -1,60 +0,0 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, min_ios_version_supported
prepare_react_native_project!
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'WechatLibExample' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'WechatLibExampleTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end

View File

@ -1,629 +0,0 @@
PODS:
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- FBLazyVector (0.71.3)
- FBReactNativeSpec (0.71.3):
- RCT-Folly (= 2021.07.22.00)
- RCTRequired (= 0.71.3)
- RCTTypeSafety (= 0.71.3)
- React-Core (= 0.71.3)
- React-jsi (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- Flipper (0.125.0):
- Flipper-Folly (~> 2.6)
- Flipper-RSocket (~> 1.4)
- Flipper-Boost-iOSX (1.76.0.1.11)
- Flipper-DoubleConversion (3.2.0.1)
- Flipper-Fmt (7.1.7)
- Flipper-Folly (2.6.10):
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt (= 7.1.7)
- Flipper-Glog
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.1100)
- Flipper-Glog (0.5.0.5)
- Flipper-PeerTalk (0.0.4)
- Flipper-RSocket (1.4.3):
- Flipper-Folly (~> 2.6)
- FlipperKit (0.125.0):
- FlipperKit/Core (= 0.125.0)
- FlipperKit/Core (0.125.0):
- Flipper (~> 0.125.0)
- FlipperKit/CppBridge
- FlipperKit/FBCxxFollyDynamicConvert
- FlipperKit/FBDefines
- FlipperKit/FKPortForwarding
- SocketRocket (~> 0.6.0)
- FlipperKit/CppBridge (0.125.0):
- Flipper (~> 0.125.0)
- FlipperKit/FBCxxFollyDynamicConvert (0.125.0):
- Flipper-Folly (~> 2.6)
- FlipperKit/FBDefines (0.125.0)
- FlipperKit/FKPortForwarding (0.125.0):
- CocoaAsyncSocket (~> 7.6)
- Flipper-PeerTalk (~> 0.0.4)
- FlipperKit/FlipperKitHighlightOverlay (0.125.0)
- FlipperKit/FlipperKitLayoutHelpers (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutTextSearchable
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- FlipperKit/FlipperKitLayoutIOSDescriptors
- FlipperKit/FlipperKitLayoutTextSearchable
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutTextSearchable (0.125.0)
- FlipperKit/FlipperKitNetworkPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitReactPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/SKIOSNetworkPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5)
- hermes-engine (0.71.3):
- hermes-engine/Pre-built (= 0.71.3)
- hermes-engine/Pre-built (0.71.3)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly/Default (= 2021.07.22.00)
- RCT-Folly/Default (2021.07.22.00):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly/Futures (2021.07.22.00):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- libevent
- RCTRequired (0.71.3)
- RCTTypeSafety (0.71.3):
- FBLazyVector (= 0.71.3)
- RCTRequired (= 0.71.3)
- React-Core (= 0.71.3)
- React (0.71.3):
- React-Core (= 0.71.3)
- React-Core/DevSupport (= 0.71.3)
- React-Core/RCTWebSocket (= 0.71.3)
- React-RCTActionSheet (= 0.71.3)
- React-RCTAnimation (= 0.71.3)
- React-RCTBlob (= 0.71.3)
- React-RCTImage (= 0.71.3)
- React-RCTLinking (= 0.71.3)
- React-RCTNetwork (= 0.71.3)
- React-RCTSettings (= 0.71.3)
- React-RCTText (= 0.71.3)
- React-RCTVibration (= 0.71.3)
- React-callinvoker (0.71.3)
- React-Codegen (0.71.3):
- FBReactNativeSpec
- hermes-engine
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-Core
- React-jsi
- React-jsiexecutor
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- React-Core (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.3)
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/CoreModulesHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/Default (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/DevSupport (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.3)
- React-Core/RCTWebSocket (= 0.71.3)
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-jsinspector (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTActionSheetHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTAnimationHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTBlobHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTImageHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTLinkingHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTNetworkHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTSettingsHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTTextHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTVibrationHeaders (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-Core/RCTWebSocket (0.71.3):
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.3)
- React-cxxreact (= 0.71.3)
- React-hermes
- React-jsi (= 0.71.3)
- React-jsiexecutor (= 0.71.3)
- React-perflogger (= 0.71.3)
- Yoga
- React-CoreModules (0.71.3):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.3)
- React-Codegen (= 0.71.3)
- React-Core/CoreModulesHeaders (= 0.71.3)
- React-jsi (= 0.71.3)
- React-RCTBlob
- React-RCTImage (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-cxxreact (0.71.3):
- boost (= 1.76.0)
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.3)
- React-jsi (= 0.71.3)
- React-jsinspector (= 0.71.3)
- React-logger (= 0.71.3)
- React-perflogger (= 0.71.3)
- React-runtimeexecutor (= 0.71.3)
- React-hermes (0.71.3):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- RCT-Folly/Futures (= 2021.07.22.00)
- React-cxxreact (= 0.71.3)
- React-jsi
- React-jsiexecutor (= 0.71.3)
- React-jsinspector (= 0.71.3)
- React-perflogger (= 0.71.3)
- React-jsi (0.71.3):
- boost (= 1.76.0)
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-jsiexecutor (0.71.3):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 0.71.3)
- React-jsi (= 0.71.3)
- React-perflogger (= 0.71.3)
- React-jsinspector (0.71.3)
- React-logger (0.71.3):
- glog
- react-native-wechat-lib (3.0.7):
- React-Core
- React-perflogger (0.71.3)
- React-RCTActionSheet (0.71.3):
- React-Core/RCTActionSheetHeaders (= 0.71.3)
- React-RCTAnimation (0.71.3):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.3)
- React-Codegen (= 0.71.3)
- React-Core/RCTAnimationHeaders (= 0.71.3)
- React-jsi (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-RCTAppDelegate (0.71.3):
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-Core
- ReactCommon/turbomodule/core
- React-RCTBlob (0.71.3):
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.71.3)
- React-Core/RCTBlobHeaders (= 0.71.3)
- React-Core/RCTWebSocket (= 0.71.3)
- React-jsi (= 0.71.3)
- React-RCTNetwork (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-RCTImage (0.71.3):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.3)
- React-Codegen (= 0.71.3)
- React-Core/RCTImageHeaders (= 0.71.3)
- React-jsi (= 0.71.3)
- React-RCTNetwork (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-RCTLinking (0.71.3):
- React-Codegen (= 0.71.3)
- React-Core/RCTLinkingHeaders (= 0.71.3)
- React-jsi (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-RCTNetwork (0.71.3):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.3)
- React-Codegen (= 0.71.3)
- React-Core/RCTNetworkHeaders (= 0.71.3)
- React-jsi (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-RCTSettings (0.71.3):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.3)
- React-Codegen (= 0.71.3)
- React-Core/RCTSettingsHeaders (= 0.71.3)
- React-jsi (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-RCTText (0.71.3):
- React-Core/RCTTextHeaders (= 0.71.3)
- React-RCTVibration (0.71.3):
- RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.71.3)
- React-Core/RCTVibrationHeaders (= 0.71.3)
- React-jsi (= 0.71.3)
- ReactCommon/turbomodule/core (= 0.71.3)
- React-runtimeexecutor (0.71.3):
- React-jsi (= 0.71.3)
- ReactCommon/turbomodule/bridging (0.71.3):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.3)
- React-Core (= 0.71.3)
- React-cxxreact (= 0.71.3)
- React-jsi (= 0.71.3)
- React-logger (= 0.71.3)
- React-perflogger (= 0.71.3)
- ReactCommon/turbomodule/core (0.71.3):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.3)
- React-Core (= 0.71.3)
- React-cxxreact (= 0.71.3)
- React-jsi (= 0.71.3)
- React-logger (= 0.71.3)
- React-perflogger (= 0.71.3)
- SocketRocket (0.6.0)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- Flipper (= 0.125.0)
- Flipper-Boost-iOSX (= 1.76.0.1.11)
- Flipper-DoubleConversion (= 3.2.0.1)
- Flipper-Fmt (= 7.1.7)
- Flipper-Folly (= 2.6.10)
- Flipper-Glog (= 0.5.0.5)
- Flipper-PeerTalk (= 0.0.4)
- Flipper-RSocket (= 1.4.3)
- FlipperKit (= 0.125.0)
- FlipperKit/Core (= 0.125.0)
- FlipperKit/CppBridge (= 0.125.0)
- FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0)
- FlipperKit/FBDefines (= 0.125.0)
- FlipperKit/FKPortForwarding (= 0.125.0)
- FlipperKit/FlipperKitHighlightOverlay (= 0.125.0)
- FlipperKit/FlipperKitLayoutPlugin (= 0.125.0)
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0)
- FlipperKit/FlipperKitNetworkPlugin (= 0.125.0)
- FlipperKit/FlipperKitReactPlugin (= 0.125.0)
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
- FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.1100)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
- React (from `../node_modules/react-native/`)
- React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
- React-Codegen (from `build/generated/ios`)
- React-Core (from `../node_modules/react-native/`)
- React-Core/DevSupport (from `../node_modules/react-native/`)
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
- React-hermes (from `../node_modules/react-native/ReactCommon/hermes`)
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-wechat-lib (from `../..`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`)
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
- React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
- React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
- React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
- React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
- React-RCTText (from `../node_modules/react-native/Libraries/Text`)
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
trunk:
- CocoaAsyncSocket
- Flipper
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt
- Flipper-Folly
- Flipper-Glog
- Flipper-PeerTalk
- Flipper-RSocket
- FlipperKit
- fmt
- libevent
- OpenSSL-Universal
- SocketRocket
- YogaKit
EXTERNAL SOURCES:
boost:
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
:path: "../node_modules/react-native/Libraries/FBLazyVector"
FBReactNativeSpec:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
hermes-engine:
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
:path: "../node_modules/react-native/Libraries/RCTRequired"
RCTTypeSafety:
:path: "../node_modules/react-native/Libraries/TypeSafety"
React:
:path: "../node_modules/react-native/"
React-callinvoker:
:path: "../node_modules/react-native/ReactCommon/callinvoker"
React-Codegen:
:path: build/generated/ios
React-Core:
:path: "../node_modules/react-native/"
React-CoreModules:
:path: "../node_modules/react-native/React/CoreModules"
React-cxxreact:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
React-hermes:
:path: "../node_modules/react-native/ReactCommon/hermes"
React-jsi:
:path: "../node_modules/react-native/ReactCommon/jsi"
React-jsiexecutor:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-wechat-lib:
:path: "../.."
React-perflogger:
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
React-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation:
:path: "../node_modules/react-native/Libraries/NativeAnimation"
React-RCTAppDelegate:
:path: "../node_modules/react-native/Libraries/AppDelegate"
React-RCTBlob:
:path: "../node_modules/react-native/Libraries/Blob"
React-RCTImage:
:path: "../node_modules/react-native/Libraries/Image"
React-RCTLinking:
:path: "../node_modules/react-native/Libraries/LinkingIOS"
React-RCTNetwork:
:path: "../node_modules/react-native/Libraries/Network"
React-RCTSettings:
:path: "../node_modules/react-native/Libraries/Settings"
React-RCTText:
:path: "../node_modules/react-native/Libraries/Text"
React-RCTVibration:
:path: "../node_modules/react-native/Libraries/Vibration"
React-runtimeexecutor:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 60195509584153283780abdac5569feffb8f08cc
FBReactNativeSpec: 9c191fb58d06dc05ab5559a5505fc32139e9e4a2
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 38bfe887e456b33b697187570a08de33969f5db7
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: bec48f07daf7bcdc2655a0cde84e07d24d2a9e2a
RCTTypeSafety: 171394eebacf71e1cfad79dbfae7ee8fc16ca80a
React: d7433ccb6a8c36e4cbed59a73c0700fc83c3e98a
React-callinvoker: 15f165009bd22ae829b2b600e50bcc98076ce4b8
React-Codegen: b5910000eaf1e0c2f47d29be6f82f5f1264420d7
React-Core: b6f2f78d580a90b83fd7b0d1c6911c799f6eac82
React-CoreModules: e0cbc1a4f4f3f60e23c476fef7ab37be363ea8c1
React-cxxreact: c87f3f124b2117d00d410b35f16c2257e25e50fa
React-hermes: c64ca6bdf16a7069773103c9bedaf30ec90ab38f
React-jsi: 39729361645568e238081b3b3180fbad803f25a4
React-jsiexecutor: 515b703d23ffadeac7687bc2d12fb08b90f0aaa1
React-jsinspector: 9f7c9137605e72ca0343db4cea88006cb94856dd
React-logger: 957e5dc96d9dbffc6e0f15e0ee4d2b42829ff207
react-native-wechat-lib: d37f3f48a00b7bb31a79ec1b23574881457788c9
React-perflogger: af8a3d31546077f42d729b949925cc4549f14def
React-RCTActionSheet: 57cc5adfefbaaf0aae2cf7e10bccd746f2903673
React-RCTAnimation: 11c61e94da700c4dc915cf134513764d87fc5e2b
React-RCTAppDelegate: c3980adeaadcfd6cb495532e928b36ac6db3c14a
React-RCTBlob: ccc5049d742b41971141415ca86b83b201495695
React-RCTImage: 7a9226b0944f1e76e8e01e35a9245c2477cdbabb
React-RCTLinking: bbe8cc582046a9c04f79c235b73c93700263e8b4
React-RCTNetwork: fc2ca322159dc54e06508d4f5c3e934da63dc013
React-RCTSettings: f1e9db2cdf946426d3f2b210e4ff4ce0f0d842ef
React-RCTText: 1c41dd57e5d742b1396b4eeb251851ce7ff0fca1
React-RCTVibration: 5199a180d04873366a83855de55ac33ce60fe4d5
React-runtimeexecutor: 7bf0dafc7b727d93c8cb94eb00a9d3753c446c3e
ReactCommon: 6f65ea5b7d84deb9e386f670dd11ce499ded7b40
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: 5ed1699acbba8863755998a4245daa200ff3817b
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: 3e0608910f8aee329702f393731ceca84ecddaf5
COCOAPODS: 1.11.3

View File

@ -1,720 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* WechatLibExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* WechatLibExampleTests.m */; };
0C80B921A6F3F58F76C31292 /* libPods-WechatLibExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-WechatLibExample.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
7699B88040F8A987B510C191 /* libPods-WechatLibExample-WechatLibExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-WechatLibExample-WechatLibExampleTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
869359A329A52416006D40AA /* libWeChatSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 869359A229A52416006D40AA /* libWeChatSDK.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = WechatLibExample;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
00E356EE1AD99517003FC87E /* WechatLibExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WechatLibExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* WechatLibExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WechatLibExampleTests.m; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* WechatLibExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WechatLibExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = WechatLibExample/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = WechatLibExample/AppDelegate.mm; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = WechatLibExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = WechatLibExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = WechatLibExample/main.m; sourceTree = "<group>"; };
19F6CBCC0A4E27FBF8BF4A61 /* libPods-WechatLibExample-WechatLibExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WechatLibExample-WechatLibExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B4392A12AC88292D35C810B /* Pods-WechatLibExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WechatLibExample.debug.xcconfig"; path = "Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-WechatLibExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WechatLibExample.release.xcconfig"; path = "Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample.release.xcconfig"; sourceTree = "<group>"; };
5B7EB9410499542E8C5724F5 /* Pods-WechatLibExample-WechatLibExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WechatLibExample-WechatLibExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-WechatLibExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WechatLibExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = WechatLibExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
869359A229A52416006D40AA /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-WechatLibExample-WechatLibExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WechatLibExample-WechatLibExampleTests.release.xcconfig"; path = "Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
00E356EB1AD99517003FC87E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7699B88040F8A987B510C191 /* libPods-WechatLibExample-WechatLibExampleTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
869359A329A52416006D40AA /* libWeChatSDK.a in Frameworks */,
0C80B921A6F3F58F76C31292 /* libPods-WechatLibExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
00E356EF1AD99517003FC87E /* WechatLibExampleTests */ = {
isa = PBXGroup;
children = (
00E356F21AD99517003FC87E /* WechatLibExampleTests.m */,
00E356F01AD99517003FC87E /* Supporting Files */,
);
path = WechatLibExampleTests;
sourceTree = "<group>";
};
00E356F01AD99517003FC87E /* Supporting Files */ = {
isa = PBXGroup;
children = (
00E356F11AD99517003FC87E /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
13B07FAE1A68108700A75B9A /* WechatLibExample */ = {
isa = PBXGroup;
children = (
869359A229A52416006D40AA /* libWeChatSDK.a */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB71A68108700A75B9A /* main.m */,
);
name = WechatLibExample;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
5DCACB8F33CDC322A6C60F78 /* libPods-WechatLibExample.a */,
19F6CBCC0A4E27FBF8BF4A61 /* libPods-WechatLibExample-WechatLibExampleTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
);
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* WechatLibExample */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* WechatLibExampleTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
BBD78D7AC51CEA395F1C20DB /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
tabWidth = 2;
usesTabs = 0;
};
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* WechatLibExample.app */,
00E356EE1AD99517003FC87E /* WechatLibExampleTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
3B4392A12AC88292D35C810B /* Pods-WechatLibExample.debug.xcconfig */,
5709B34CF0A7D63546082F79 /* Pods-WechatLibExample.release.xcconfig */,
5B7EB9410499542E8C5724F5 /* Pods-WechatLibExample-WechatLibExampleTests.debug.xcconfig */,
89C6BE57DB24E9ADA2F236DE /* Pods-WechatLibExample-WechatLibExampleTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
00E356ED1AD99517003FC87E /* WechatLibExampleTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "WechatLibExampleTests" */;
buildPhases = (
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
00E356F51AD99517003FC87E /* PBXTargetDependency */,
);
name = WechatLibExampleTests;
productName = WechatLibExampleTests;
productReference = 00E356EE1AD99517003FC87E /* WechatLibExampleTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
13B07F861A680F5B00A75B9A /* WechatLibExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "WechatLibExample" */;
buildPhases = (
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = WechatLibExample;
productName = WechatLibExample;
productReference = 13B07F961A680F5B00A75B9A /* WechatLibExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1210;
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
LastSwiftMigration = 1120;
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "WechatLibExample" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* WechatLibExample */,
00E356ED1AD99517003FC87E /* WechatLibExampleTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
00E356EC1AD99517003FC87E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8E1A680F5B00A75B9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(SRCROOT)/.xcode.env.local",
"$(SRCROOT)/.xcode.env",
);
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-WechatLibExample-WechatLibExampleTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-WechatLibExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample/Pods-WechatLibExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WechatLibExample-WechatLibExampleTests/Pods-WechatLibExample-WechatLibExampleTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Start Packager";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
00E356EA1AD99517003FC87E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* WechatLibExampleTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F871A680F5B00A75B9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 13B07F861A680F5B00A75B9A /* WechatLibExample */;
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-WechatLibExample-WechatLibExampleTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = WechatLibExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WechatLibExample.app/WechatLibExample";
};
name = Debug;
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-WechatLibExample-WechatLibExampleTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = WechatLibExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WechatLibExample.app/WechatLibExample";
};
name = Release;
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-WechatLibExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 865ZADD3MJ;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = WechatLibExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
"$(PROJECT_DIR)",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = WechatLibExample;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-WechatLibExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 865ZADD3MJ;
INFOPLIST_FILE = WechatLibExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
"$(PROJECT_DIR)",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = WechatLibExample;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
83CBBA201A601CBA00E9B192 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
name = Debug;
};
83CBBA211A601CBA00E9B192 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "WechatLibExampleTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
00E356F61AD99517003FC87E /* Debug */,
00E356F71AD99517003FC87E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "WechatLibExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
13B07F951A680F5B00A75B9A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "WechatLibExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
83CBBA211A601CBA00E9B192 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
}

View File

@ -1,6 +0,0 @@
#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : RCTAppDelegate
@end

View File

@ -1,36 +0,0 @@
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"WechatLibExample";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
return true;
}
@end

View File

@ -1,53 +0,0 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WechatLibExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
</document>

View File

@ -1,10 +0,0 @@
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

Binary file not shown.

View File

@ -1,40 +0,0 @@
const path = require('path');
const escape = require('escape-string-regexp');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const pak = require('../package.json');
const root = path.resolve(__dirname, '..');
const modules = Object.keys({
...pak.peerDependencies,
});
module.exports = {
projectRoot: __dirname,
watchFolders: [root],
// We need to make sure that only one version is loaded for peerDependencies
// So we block them at the root, and alias them to the versions in example's node_modules
resolver: {
blacklistRE: exclusionList(
modules.map(
(m) =>
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
)
),
extraNodeModules: modules.reduce((acc, name) => {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};

View File

@ -1,22 +0,0 @@
{
"name": "WechatLibExample",
"version": "3.0.0",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"pods": "pod-install --quiet"
},
"dependencies": {
"react": "18.1.0",
"react-native": "0.71.3",
"react-native-wechat-lib": "^3.0.0"
},
"devDependencies": {
"@babel/core": "7.12.9",
"@babel/runtime": "7.12.5",
"metro-react-native-babel-preset": "0.72.3",
"babel-plugin-module-resolver": "4.1.0"
}
}

View File

@ -1,10 +0,0 @@
const path = require('path');
const pak = require('../package.json');
module.exports = {
dependencies: {
[pak.name]: {
root: path.join(__dirname, '..'),
},
},
};

View File

@ -1,96 +0,0 @@
import * as React from 'react';
import { StyleSheet, View, Text, Button, Alert } from 'react-native';
import { getApiVersion, registerApp, openWXApp, sendAuthRequest, shareText } from 'react-native-wechat-lib';
export default function App() {
const [versionNumber, setVersionNumber] = React.useState<string | undefined>();
React.useEffect(() => {
registerApp('wx7973caefdffba1b8', 'universalLink').then((res) => {
console.log("registerApp: " + res)
getApiVersion().then((num) => {
console.log("test: " + num)
setVersionNumber(num)
// openWXApp().then()
})
});
}, []);
function onLogin() {
sendAuthRequest('snsapi_userinfo', '')
.then((response: any) => {
// todo 登录 response.code
Alert.alert('登录成功code: ' + response.code)
})
.catch(error => {
console.log(error)
let errorCode = Number(error.code);
if (errorCode === -2) {
Alert.alert('已取消授权登录')
} else {
Alert.alert('微信授权登录失败')
}
});
}
function onShareText() {
shareText({
text: 'test content.',
scene: 0
}).then()
}
return (
<View style={styles.container}>
<Text style={styles.title}>Call wechat SDK demo</Text>
<Text style={styles.versionBox}>
Version: {versionNumber}
</Text>
<View style={styles.buttonGroup}>
<View style={styles.button}>
<Button title={'拉起微信'} onPress={() => { openWXApp().then() }} />
</View>
<View style={styles.button}>
<Button title={'授权登录'} onPress={() => { onLogin() }} />
</View>
<View style={styles.button}>
<Button title={'分享'} onPress={() => { onShareText() }} />
</View>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
width: '100%',
// flex: 1,
alignItems: 'center',
// justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
title: {
marginTop: 48,
fontSize: 24,
color: 'rgba(0, 0, 0, 0.6)',
},
versionBox: {
color: 'rgba(0, 0, 0, 0.6)'
},
buttonGroup: {
width: '100%',
padding: 6,
marginTop: 24,
},
button: {
margin: 6,
}
});

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

View File

@ -9,14 +9,7 @@ enum WXScene {
}
declare module 'react-native-wechat-lib' {
export function registerApp(
appId: string,
universalLink?: string
): Promise<boolean>;
export function openCustomerServiceChat(
corpId: string,
kfUrl: string
): Promise<string>;
export function registerApp(appId: string, universalLink?: string): Promise<boolean>;
export function isWXAppInstalled(): Promise<boolean>;
export function isWXAppSupportApi(): Promise<boolean>;
export function getApiVersion(): Promise<string>;
@ -46,30 +39,9 @@ declare module 'react-native-wechat-lib' {
state?: string;
returnKey?: string;
}
export interface ScanLoginResp {
nickname?: string;
headimgurl?: string;
openid?: string;
unionid?: string;
errCode?: number;
errStr?: string;
}
export function sendAuthRequest(
scope: string | string[],
state?: string
): Promise<AuthResponse>;
export function authByScan(appId: string, appSecret: string, onQRGet: (qrcode: string)=>void): Promise<ScanLoginResp>;
export function sendAuthRequest(scope: string | string[], state?: string): Promise<AuthResponse>;
export interface ShareMetadata {
type:
| 'news'
| 'text'
| 'imageUrl'
| 'imageFile'
| 'imageResource'
| 'video'
| 'audio'
| 'file';
type: 'news' | 'text' | 'imageUrl' | 'imageFile' | 'imageResource' | 'video' | 'audio' | 'file';
thumbImage?: string;
description?: string;
webpageUrl?: string;
@ -137,31 +109,31 @@ declare module 'react-native-wechat-lib' {
}
export function shareText(
message: ShareTextMetadata
message: ShareTextMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function shareImage(
message: ShareImageMetadata
message: ShareImageMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function shareLocalImage(
message: ShareImageMetadata
message: ShareImageMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function shareMusic(
message: ShareMusicMetadata
message: ShareMusicMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function shareVideo(
message: ShareVideoMetadata
message: ShareVideoMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function shareWebpage(
message: ShareWebpageMetadata
message: ShareWebpageMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function shareMiniProgram(
message: ShareMiniProgramMetadata
message: ShareMiniProgramMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function launchMiniProgram(
message: LaunchMiniProgramMetadata
message: LaunchMiniProgramMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export function subscribeMessage(
message: SubscribeMessageMetadata
message: SubscribeMessageMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
export interface PaymentLoad {
partnerId: string;
@ -171,9 +143,7 @@ declare module 'react-native-wechat-lib' {
package: string;
sign: string;
}
export function pay(
payload: PaymentLoad
): Promise<{ errCode?: number; errStr?: string }>;
export function pay(payload: PaymentLoad): Promise<{ errCode?: number; errStr?: string }>;
export interface ChooseInvoice {
signType?: string;
@ -189,7 +159,7 @@ declare module 'react-native-wechat-lib' {
}
export function chooseInvoice(
data: ChooseInvoice
data: ChooseInvoice,
): Promise<{ errCode?: number; errStr?: string; cards: Invoice[] }>;
export interface ShareFileMetadata {
@ -199,6 +169,6 @@ declare module 'react-native-wechat-lib' {
scene?: WXScene;
}
export function shareFile(
data: ShareFileMetadata
data: ShareFileMetadata,
): Promise<{ errCode?: number; errStr?: string }>;
}

View File

@ -1,15 +1,10 @@
'use strict';
import { DeviceEventEmitter, NativeModules, Platform } from 'react-native';
import { EventEmitter } from 'events';
import { sha1 } from 'js-sha1';
import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform } from 'react-native';
let isAppRegistered = false;
let { WeChat, WechatLib } = NativeModules;
if (WeChat == null) {
WeChat = WechatLib;
}
const { WeChat } = NativeModules;
// Event emitter to dispatch request and response from WeChat.
const emitter = new EventEmitter();
@ -147,19 +142,13 @@ export const getApiVersion = wrapApi(WeChat.getApiVersion);
* @return {Promise}
*/
export const openWXApp = wrapApi(WeChat.openWXApp);
/**
* Open wechat app
* @method openCustomerServiceChat
* @return {Promise}
*/
export const openCustomerServiceChat = wrapApi(WeChat.openCustomerServiceChat);
// wrap the APIs
// const nativeShareToTimeline = wrapApi(WeChat.shareToTimeline);
const nativeShareToTimeline = wrapApi(WeChat.shareToTimeline);
const nativeLaunchMiniProgram = wrapApi(WeChat.launchMiniProgram);
// const nativeShareToSession = wrapApi(WeChat.shareToSession);
const nativeShareToSession = wrapApi(WeChat.shareToSession);
const nativeShareToFavorite = wrapApi(WeChat.shareToFavorite);
// const nativeSendAuthRequest = wrapApi(WeChat.sendAuthRequest);
const nativeSendAuthRequest = wrapApi(WeChat.sendAuthRequest);
const nativeShareText = wrapApi(WeChat.shareText);
const nativeShareImage = wrapApi(WeChat.shareImage);
const nativeShareLocalImage = wrapApi(WeChat.shareLocalImage);
@ -171,152 +160,6 @@ const nativeSubscribeMessage = wrapApi(WeChat.subscribeMessage);
const nativeChooseInvoice = wrapApi(WeChat.chooseInvoice);
const nativeShareFile = wrapApi(WeChat.shareFile);
const nativeScan = wrapApi(WeChat.authByScan);
// https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token.html
const getAccessToken = async (WeiXinId, WeiXinSecret) => {
let url =
'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' +
WeiXinId +
'&secret=' +
WeiXinSecret;
const response = await fetch(url);
const res = await response.json();
return res.access_token;
};
const getSDKTicket = async (accessToken) => {
let url =
'https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=2&access_token=' +
accessToken;
const response = await fetch(url);
const res = await response.json();
return res.ticket;
};
const createSignature = (
WeiXinId,
nonceStr,
sdkTicket,
timestamp
) => {
const origin =
'appid=' +
WeiXinId +
'&noncestr=' +
nonceStr +
'&sdk_ticket=' +
sdkTicket +
'&timestamp=' +
timestamp;
const ret = sha1(origin);
// console.log('wx scan signature', origin, ret);
return ret;
};
const getUserInfo = (
WeiXinId,
WeiXinSecret,
code,
callback
) => {
let accessTokenUrl =
'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' +
WeiXinId +
'&secret=' +
WeiXinSecret +
'&code=' +
code +
'&grant_type=authorization_code';
fetch(accessTokenUrl)
.then((res) => {
return res.json();
})
.then((res) => {
// console.log('wechat get access code success: ', res.access_token);
let userInfoUrl =
'https://api.weixin.qq.com/sns/userinfo?access_token=' +
res.access_token +
'&openid=' +
res.openid;
fetch(userInfoUrl)
.then((res2) => {
return res2.json();
})
.then((json) => {
// console.log('wechat get user info success: ', json);
callback({
nickname: json.nickname,
headimgurl: json.headimgurl,
openid: json.openid,
unionid: json.unionid,
});
})
.catch((e) => {
console.warn('wechat get user info fail ', e);
callback({ error: e });
});
})
.catch((e) => {
console.warn('wechat get access code fail ', e);
callback({ error: e });
});
};
const generateObjectId = () => {
var timestamp = ((new Date().getTime() / 1000) | 0).toString(16); // eslint-disable-line no-bitwise
return (
timestamp +
'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function () {
return ((Math.random() * 16) | 0).toString(16).toLowerCase(); // eslint-disable-line no-bitwise
})
);
}
/**
* @method authByScan
* @param {String} appId - the app id
* @param {String} appSecret - the app secret
* @param {Function} onQRGet - (qrcode: string) => void
* @return {Promise}
*/
export function authByScan(appId, appSecret, onQRGet) {
return new Promise(async (resolve, reject) => {
const accessToken = await getAccessToken(appId, appSecret);
const ticket = await getSDKTicket(accessToken);
const nonceStr = generateObjectId();
const timestamp = String(Math.round(Date.now() / 1000));
const signature = createSignature(appId, nonceStr, ticket, timestamp);
const qrcodeEmitter = new NativeEventEmitter(NativeModules.WeChat);
const subscription = qrcodeEmitter.addListener('onAuthGotQrcode', (res) =>
onQRGet && onQRGet(res.qrcode)
);
const ret = await nativeScan(appId, nonceStr, timestamp, 'snsapi_userinfo', signature, '');
// console.log('扫码结果', ret)
subscription.remove();
if (!ret?.authCode) {
reject(new WechatError({
errStr: 'Auth code 获取失败',
errCode: -1
}))
return;
}
getUserInfo(appId, appSecret, ret?.authCode, (result) => {
// console.log('扫码登录结果', result)
if (!result.error) {
resolve(result)
} else {
reject(new WechatError({
errStr: '扫码登录失败' + JSON.stringify(e),
errCode: -2
}))
}
});
});
}
/**
* @method sendAuthRequest
@ -371,8 +214,8 @@ export function chooseInvoice(data = {}) {
const cardItemList = JSON.parse(resp.cardItemList);
resp.cards = cardItemList
? cardItemList.map((item) => ({
cardId: item.card_id,
encryptCode: item.encrypt_code,
cardId: item.card_id,
encryptCode: item.encrypt_code,
}))
: [];
}
@ -538,22 +381,14 @@ export function shareMiniProgram(data) {
* @param {Integer} miniProgramType - 拉起小程序的类型. 0-正式版 1-开发版 2-体验版
* @param {String} path - 拉起小程序页面的可带参路径不填默认拉起小程序首页
*/
export function launchMiniProgram({
userName,
miniProgramType = 0,
path = '',
}) {
export function launchMiniProgram({ userName, miniProgramType = 0, path = '' }) {
return new Promise((resolve, reject) => {
if (
miniProgramType !== 0 &&
miniProgramType !== 1 &&
miniProgramType !== 2
) {
if (miniProgramType !== 0 && miniProgramType !== 1 && miniProgramType !== 2) {
reject(
new WechatError({
errStr: '拉起小程序的类型不对0-正式版 1-开发版 2-体验版',
errCode: -1,
})
}),
);
return;
}

View File

@ -24,7 +24,7 @@
#define RCTWXEventName @"WeChat_Resp"
#define RCTWXEventNameWeChatReq @"WeChat_Req"
@interface WechatLib : NSObject <RCTBridgeModule, WXApiDelegate>
@interface RCTWeChat : NSObject <RCTBridgeModule, WXApiDelegate>
@property NSString* appId;

View File

@ -1,54 +1,51 @@
// Created by little-snow-fox on 2019-10-9.
#import "RCTWeChat.h"
#import "WXApiObject.h"
#import "WechatLib.h"
#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTImageLoader.h>
#import <React/RCTBridge.h>
#import <React/RCTLog.h>
#import "WechatAuthSDK.h"
@interface WechatLib () <WechatAuthAPIDelegate>
@property (nonatomic, strong) WechatAuthSDK *authSDK;
@property (nonatomic, strong) RCTResponseSenderBlock scanCallback;
@end
@implementation WechatLib
#import <React/RCTImageLoader.h>
// Define error messages
#define NOT_REGISTERED (@"registerApp required.")
#define INVOKE_FAILED (@"WeChat API invoke returns false.")
@implementation RCTWeChat
@synthesize bridge = _bridge;
RCT_EXPORT_MODULE()
- (instancetype)init {
- (instancetype)init
{
self = [super init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:@"RCTOpenURLNotification" object:nil];
self.authSDK = [[WechatAuthSDK alloc] init];
self.authSDK.delegate = self;
}
return self;
}
- (void)dealloc {
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (BOOL)handleOpenURL:(NSNotification *)aNotification {
NSString *aURLString = [aNotification userInfo][@"url"];
NSURL *aURL = [NSURL URLWithString:aURLString];
if ([WXApi handleOpenURL:aURL delegate:self]) {
- (BOOL)handleOpenURL:(NSNotification *)aNotification
{
NSString * aURLString = [aNotification userInfo][@"url"];
NSURL * aURL = [NSURL URLWithString:aURLString];
if ([WXApi handleOpenURL:aURL delegate:self])
{
return YES;
} else {
return NO;
}
}
- (dispatch_queue_t)methodQueue {
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
@ -57,9 +54,9 @@ RCT_EXPORT_MODULE()
}
//
- (UIImage *)getImageFromURL:(NSString *)fileURL {
UIImage *result;
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:fileURL]];
- (UIImage *) getImageFromURL:(NSString *)fileURL {
UIImage * result;
NSData * data = [NSData dataWithContentsOfURL:[NSURL URLWithString:fileURL]];
result = [UIImage imageWithData:data];
return result;
}
@ -70,7 +67,7 @@ RCT_EXPORT_MODULE()
CGFloat compression = 1;
NSData *data = UIImageJPEGRepresentation(image, compression);
if (data.length < maxLength) return data;
CGFloat max = 1;
CGFloat min = 0;
for (int i = 0; i < 6; ++i) {
@ -86,32 +83,32 @@ RCT_EXPORT_MODULE()
}
UIImage *resultImage = [UIImage imageWithData:data];
if (data.length < maxLength) return data;
// Compress by size
NSUInteger lastDataLength = 0;
while (data.length > maxLength && data.length != lastDataLength) {
lastDataLength = data.length;
CGFloat ratio = (CGFloat)maxLength / data.length;
CGSize size = CGSizeMake((NSUInteger)(resultImage.size.width * sqrtf(ratio)),
(NSUInteger)(resultImage.size.height * sqrtf(ratio))); // Use NSUInteger to prevent white blank
(NSUInteger)(resultImage.size.height * sqrtf(ratio))); // Use NSUInteger to prevent white blank
UIGraphicsBeginImageContext(size);
[resultImage drawInRect:CGRectMake(0, 0, size.width, size.height)];
resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
data = UIImageJPEGRepresentation(resultImage, compression);
}
if (data.length > maxLength) {
return [self compressImage:resultImage toByte:maxLength];
}
return data;
}
RCT_EXPORT_METHOD(registerApp
:(NSString *)appid
RCT_EXPORT_METHOD(registerApp:(NSString *)appid
:(NSString *)universalLink
:(RCTResponseSenderBlock)callback) {
:(RCTResponseSenderBlock)callback)
{
self.appId = appid;
callback(@[[WXApi registerApp:appid universalLink:universalLink] ? [NSNull null] : INVOKE_FAILED]);
}
@ -123,49 +120,56 @@ RCT_EXPORT_METHOD(registerApp
// callback(@[[WXApi registerApp:appid withDescription:appdesc] ? [NSNull null] : INVOKE_FAILED]);
// }
RCT_EXPORT_METHOD(isWXAppInstalled:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(isWXAppInstalled:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], @([WXApi isWXAppInstalled])]);
}
RCT_EXPORT_METHOD(isWXAppSupportApi:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(isWXAppSupportApi:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], @([WXApi isWXAppSupportApi])]);
}
RCT_EXPORT_METHOD(getWXAppInstallUrl:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(getWXAppInstallUrl:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], [WXApi getWXAppInstallUrl]]);
}
RCT_EXPORT_METHOD(getApiVersion:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(getApiVersion:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], [WXApi getApiVersion]]);
}
RCT_EXPORT_METHOD(openWXApp:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(openWXApp:(RCTResponseSenderBlock)callback)
{
callback(@[([WXApi openWXApp] ? [NSNull null] : INVOKE_FAILED)]);
}
RCT_EXPORT_METHOD(sendRequest
:(NSString *)openid
:(RCTResponseSenderBlock)callback) {
BaseReq *req = [[BaseReq alloc] init];
RCT_EXPORT_METHOD(sendRequest:(NSString *)openid
:(RCTResponseSenderBlock)callback)
{
BaseReq* req = [[BaseReq alloc] init];
req.openID = openid;
// callback(@[[WXApi sendReq:req] ? [NSNull null] : INVOKE_FAILED]);
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
RCT_EXPORT_METHOD(sendAuthRequest
:(NSString *)scope
RCT_EXPORT_METHOD(sendAuthRequest:(NSString *)scope
:(NSString *)state
:(RCTResponseSenderBlock)callback) {
SendAuthReq *req = [[SendAuthReq alloc] init];
:(RCTResponseSenderBlock)callback)
{
SendAuthReq* req = [[SendAuthReq alloc] init];
req.scope = scope;
req.state = state;
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -173,12 +177,13 @@ RCT_EXPORT_METHOD(sendAuthRequest
[WXApi sendAuthReq:req viewController:rootViewController delegate:self completion:completion];
}
RCT_EXPORT_METHOD(sendSuccessResponse
:(RCTResponseSenderBlock)callback) {
BaseResp *resp = [[BaseResp alloc] init];
RCT_EXPORT_METHOD(sendSuccessResponse:(RCTResponseSenderBlock)callback)
{
BaseResp* resp = [[BaseResp alloc] init];
resp.errCode = WXSuccess;
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -186,14 +191,15 @@ RCT_EXPORT_METHOD(sendSuccessResponse
// callback(@[[WXApi sendResp:resp] ? [NSNull null] : INVOKE_FAILED]);
}
RCT_EXPORT_METHOD(sendErrorCommonResponse
:(NSString *)message
:(RCTResponseSenderBlock)callback) {
BaseResp *resp = [[BaseResp alloc] init];
RCT_EXPORT_METHOD(sendErrorCommonResponse:(NSString *)message
:(RCTResponseSenderBlock)callback)
{
BaseResp* resp = [[BaseResp alloc] init];
resp.errCode = WXErrCodeCommon;
resp.errStr = message;
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -201,14 +207,15 @@ RCT_EXPORT_METHOD(sendErrorCommonResponse
// callback(@[[WXApi sendResp:resp] ? [NSNull null] : INVOKE_FAILED]);
}
RCT_EXPORT_METHOD(sendErrorUserCancelResponse
:(NSString *)message
:(RCTResponseSenderBlock)callback) {
BaseResp *resp = [[BaseResp alloc] init];
RCT_EXPORT_METHOD(sendErrorUserCancelResponse:(NSString *)message
:(RCTResponseSenderBlock)callback)
{
BaseResp* resp = [[BaseResp alloc] init];
resp.errCode = WXErrCodeUserCancel;
resp.errStr = message;
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -217,15 +224,16 @@ RCT_EXPORT_METHOD(sendErrorUserCancelResponse
}
//
RCT_EXPORT_METHOD(shareText
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareText:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = YES;
req.text = data[@"text"];
req.scene = [data[@"scene"] intValue];
void (^completion)(BOOL);
completion = ^(BOOL success) {
req.scene = [data[@"scene"] integerValue];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -233,18 +241,19 @@ RCT_EXPORT_METHOD(shareText
}
//
RCT_EXPORT_METHOD(chooseInvoice
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(chooseInvoice:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXChooseInvoiceReq *req = [[WXChooseInvoiceReq alloc] init];
req.appID = self.appId;
req.timeStamp = [data[@"timeStamp"] intValue];
req.nonceStr = data[@"nonceStr"];
req.cardSign = data[@"cardSign"];
req.signType = data[@"signType"];
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -252,31 +261,26 @@ RCT_EXPORT_METHOD(chooseInvoice
}
//
RCT_EXPORT_METHOD(shareFile
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareFile:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
NSString *url = data[@"url"];
WXFileObject *file = [[WXFileObject alloc] init];
WXFileObject *file = [[WXFileObject alloc] init];
file.fileExtension = data[@"ext"];
NSData *fileData;
if ([url hasPrefix:@"http"]) {
fileData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
} else {
fileData = [NSData dataWithContentsOfFile:url];
}
NSData *fileData = [NSData dataWithContentsOfURL:[NSURL URLWithString: url]];
file.fileData = fileData;
WXMediaMessage *message = [WXMediaMessage message];
message.title = data[@"title"];
message.mediaObject = file;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = [data[@"scene"] intValue];
void (^completion)(BOOL);
completion = ^(BOOL success) {
req.scene = [data[@"scene"] integerValue];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -284,20 +288,21 @@ RCT_EXPORT_METHOD(shareFile
}
//
RCT_EXPORT_METHOD(shareImage
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareImage:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
NSString *imageUrl = data[@"imageUrl"];
if (imageUrl == NULL || [imageUrl isEqual:@""]) {
if (imageUrl == NULL || [imageUrl isEqual:@""]) {
callback([NSArray arrayWithObject:@"shareImage: The value of ImageUrl cannot be empty."]);
return;
}
NSRange range = [imageUrl rangeOfString:@"."];
if (range.length == 0) {
if ( range.length == 0)
{
callback([NSArray arrayWithObject:@"shareImage: ImageUrl value, Could not find file suffix."]);
return;
}
//
UIImage *image = [self getImageFromURL:imageUrl];
// UIImage
@ -305,21 +310,22 @@ RCT_EXPORT_METHOD(shareImage
// WXImageObject
WXImageObject *imageObject = [WXImageObject object];
imageObject.imageData = imageData;
WXMediaMessage *message = [WXMediaMessage message];
// 32KB
message.thumbData = [self compressImage:image toByte:32678];
// 32KB
message.thumbData = [self compressImage: image toByte:32678];
message.mediaObject = imageObject;
message.title = data[@"title"];
message.description = data[@"description"];
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = [data[@"scene"] intValue];
req.scene = [data[@"scene"] integerValue];
// [WXApi sendReq:req];
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -327,20 +333,21 @@ RCT_EXPORT_METHOD(shareImage
}
//
RCT_EXPORT_METHOD(shareLocalImage
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareLocalImage:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
NSString *imageUrl = data[@"imageUrl"];
if (imageUrl == NULL || [imageUrl isEqual:@""]) {
if (imageUrl == NULL || [imageUrl isEqual:@""]) {
callback([NSArray arrayWithObject:@"shareLocalImage: The value of ImageUrl cannot be empty."]);
return;
}
NSRange range = [imageUrl rangeOfString:@"."];
if (range.length == 0) {
if ( range.length == 0)
{
callback([NSArray arrayWithObject:@"shareLocalImage: ImageUrl value, Could not find file suffix."]);
return;
}
//
UIImage *image = [UIImage imageWithContentsOfFile:imageUrl];
// UIImage
@ -348,21 +355,22 @@ RCT_EXPORT_METHOD(shareLocalImage
// WXImageObject
WXImageObject *imageObject = [WXImageObject object];
imageObject.imageData = imageData;
WXMediaMessage *message = [WXMediaMessage message];
// 32KB
message.thumbData = [self compressImage:image toByte:32678];
// 32KB
message.thumbData = [self compressImage: image toByte:32678];
message.mediaObject = imageObject;
message.title = data[@"title"];
message.description = data[@"description"];
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = [data[@"scene"] intValue];
req.scene = [data[@"scene"] integerValue];
// [WXApi sendReq:req];
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -370,15 +378,15 @@ RCT_EXPORT_METHOD(shareLocalImage
}
//
RCT_EXPORT_METHOD(shareMusic
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareMusic:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXMusicObject *musicObject = [WXMusicObject object];
musicObject.musicUrl = data[@"musicUrl"];
musicObject.musicLowBandUrl = data[@"musicLowBandUrl"];
musicObject.musicDataUrl = data[@"musicDataUrl"];
musicObject.musicLowBandDataUrl = data[@"musicLowBandDataUrl"];
WXMediaMessage *message = [WXMediaMessage message];
message.title = data[@"title"];
message.description = data[@"description"];
@ -386,15 +394,16 @@ RCT_EXPORT_METHOD(shareMusic
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
//
UIImage *image = [self getImageFromURL:thumbImageUrl];
message.thumbData = [self compressImage:image toByte:32678];
message.thumbData = [self compressImage: image toByte:32678];
}
message.mediaObject = musicObject;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = [data[@"scene"] intValue];
void (^completion)(BOOL);
completion = ^(BOOL success) {
req.scene = [data[@"scene"] integerValue];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -402,9 +411,9 @@ RCT_EXPORT_METHOD(shareMusic
}
//
RCT_EXPORT_METHOD(shareVideo
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareVideo:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXVideoObject *videoObject = [WXVideoObject object];
videoObject.videoUrl = data[@"videoUrl"];
videoObject.videoLowBandUrl = data[@"videoLowBandUrl"];
@ -414,24 +423,26 @@ RCT_EXPORT_METHOD(shareVideo
NSString *thumbImageUrl = data[@"thumbImageUrl"];
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:thumbImageUrl];
message.thumbData = [self compressImage:image toByte:32678];
message.thumbData = [self compressImage: image toByte:32678];
}
message.mediaObject = videoObject;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = [data[@"scene"] intValue];
void (^completion)(BOOL);
completion = ^(BOOL success) {
req.scene = [data[@"scene"] integerValue];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
//
RCT_EXPORT_METHOD(shareWebpage
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareWebpage:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXWebpageObject *webpageObject = [WXWebpageObject object];
webpageObject.webpageUrl = data[@"webpageUrl"];
WXMediaMessage *message = [WXMediaMessage message];
@ -440,15 +451,16 @@ RCT_EXPORT_METHOD(shareWebpage
NSString *thumbImageUrl = data[@"thumbImageUrl"];
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:thumbImageUrl];
message.thumbData = [self compressImage:image toByte:32678];
message.thumbData = [self compressImage: image toByte:32678];
}
message.mediaObject = webpageObject;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = [data[@"scene"] intValue];
void (^completion)(BOOL);
completion = ^(BOOL success) {
req.scene = [data[@"scene"] integerValue];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -456,9 +468,9 @@ RCT_EXPORT_METHOD(shareWebpage
}
//
RCT_EXPORT_METHOD(shareMiniProgram
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(shareMiniProgram:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXMiniProgramObject *object = [WXMiniProgramObject object];
object.webpageUrl = data[@"webpageUrl"];
object.userName = data[@"userName"];
@ -466,29 +478,29 @@ RCT_EXPORT_METHOD(shareMiniProgram
NSString *hdImageUrl = data[@"hdImageUrl"];
if (hdImageUrl != NULL && ![hdImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:hdImageUrl];
// 128KB
object.hdImageData = [self compressImage:image toByte:131072];
// 128KB
object.hdImageData = [self compressImage: image toByte:131072];
}
object.withShareTicket = data[@"withShareTicket"];
int miniProgramType = [data[@"miniProgramType"] integerValue];
object.miniProgramType = [self integerToWXMiniProgramType:miniProgramType];
object.miniProgramType = [data[@"miniProgramType"] integerValue];
WXMediaMessage *message = [WXMediaMessage message];
message.title = data[@"title"];
message.description = data[@"description"];
// 32KB
// 使 WXMiniProgramObject hdImageData
//32KB
//使WXMiniProgramObjecthdImageData
NSString *thumbImageUrl = data[@"thumbImageUrl"];
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:thumbImageUrl];
message.thumbData = [self compressImage:image toByte:32678];
message.thumbData = [self compressImage: image toByte:32678];
}
message.mediaObject = object;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = [data[@"scene"] integerValue];
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -496,35 +508,35 @@ RCT_EXPORT_METHOD(shareMiniProgram
}
//
RCT_EXPORT_METHOD(subscribeMessage
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(subscribeMessage:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXSubscribeMsgReq *req = [[WXSubscribeMsgReq alloc] init];
req.scene = [data[@"scene"] integerValue];
req.templateId = data[@"templateId"];
req.reserved = data[@"reserved"];
void (^completion)(BOOL);
completion = ^(BOOL success) {
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
RCT_EXPORT_METHOD(launchMiniProgram
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
RCT_EXPORT_METHOD(launchMiniProgram:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object];
// username
// username
launchMiniProgramReq.userName = data[@"userName"];
//
launchMiniProgramReq.path = data[@"path"];
//
int miniProgramType = [data[@"miniProgramType"] integerValue];
launchMiniProgramReq.miniProgramType = [self integerToWXMiniProgramType:miniProgramType];
// launchMiniProgramReq.miniProgramType = [data[@"miniProgramType"] integerValue];
void (^completion)(BOOL);
completion = ^(BOOL success) {
launchMiniProgramReq.miniProgramType = [data[@"miniProgramType"] integerValue];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -533,18 +545,19 @@ RCT_EXPORT_METHOD(launchMiniProgram
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
}
RCT_EXPORT_METHOD(pay
:(NSDictionary *)data
:(RCTResponseSenderBlock)callback) {
PayReq *req = [PayReq new];
req.partnerId = data[@"partnerId"];
req.prepayId = data[@"prepayId"];
req.nonceStr = data[@"nonceStr"];
req.timeStamp = [data[@"timeStamp"] unsignedIntValue];
req.package = data[@"package"];
req.sign = data[@"sign"];
void (^completion)(BOOL);
completion = ^(BOOL success) {
RCT_EXPORT_METHOD(pay:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
PayReq* req = [PayReq new];
req.partnerId = data[@"partnerId"];
req.prepayId = data[@"prepayId"];
req.nonceStr = data[@"nonceStr"];
req.timeStamp = [data[@"timeStamp"] unsignedIntValue];
req.package = data[@"package"];
req.sign = data[@"sign"];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
@ -553,82 +566,75 @@ RCT_EXPORT_METHOD(pay
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
}
//
RCT_EXPORT_METHOD(openCustomerServiceChat
:(NSString *)corpId
:(NSString *)kfUrl
:(RCTResponseSenderBlock)callback) {
WXOpenCustomerServiceReq *req = [[WXOpenCustomerServiceReq alloc] init];
req.corpid = corpId; // ID
req.url = kfUrl; // URL
[WXApi sendReq:req completion:nil];
}
#pragma mark - wx callback
- (void)onReq:(BaseReq *)req {
-(void) onReq:(BaseReq*)req
{
if ([req isKindOfClass:[LaunchFromWXReq class]]) {
LaunchFromWXReq *launchReq = req;
NSString *appParameter = launchReq.message.messageExt;
NSMutableDictionary *body = @{ @"errCode": @0 }.mutableCopy;
NSMutableDictionary *body = @{@"errCode":@0}.mutableCopy;
body[@"type"] = @"LaunchFromWX.Req";
body[@"lang"] = launchReq.lang;
body[@"lang"] = launchReq.lang;
body[@"country"] = launchReq.country;
body[@"extMsg"] = appParameter;
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventNameWeChatReq body:body];
}
}
- (void)onResp:(BaseResp *)resp {
if ([resp isKindOfClass:[SendMessageToWXResp class]]) {
-(void) onResp:(BaseResp*)resp
{
if([resp isKindOfClass:[SendMessageToWXResp class]])
{
SendMessageToWXResp *r = (SendMessageToWXResp *)resp;
NSMutableDictionary *body = @{ @"errCode": @(r.errCode) }.mutableCopy;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
body[@"lang"] = r.lang;
body[@"country"] = r.country;
body[@"country"] =r.country;
body[@"type"] = @"SendMessageToWX.Resp";
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
} else if ([resp isKindOfClass:[SendAuthResp class]]) {
SendAuthResp *r = (SendAuthResp *)resp;
NSMutableDictionary *body = @{ @"errCode": @(r.errCode) }.mutableCopy;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
body[@"state"] = r.state;
body[@"lang"] = r.lang;
body[@"country"] = r.country;
body[@"country"] =r.country;
body[@"type"] = @"SendAuth.Resp";
if (resp.errCode == WXSuccess) {
if (self.appId && r) {
// ios appid OK
[body addEntriesFromDictionary:@{ @"appid": self.appId, @"code": r.code }];
// iosappidOK
[body addEntriesFromDictionary:@{@"appid":self.appId, @"code":r.code}];
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
}
} else {
}
else {
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
}
} else if ([resp isKindOfClass:[PayResp class]]) {
PayResp *r = (PayResp *)resp;
NSMutableDictionary *body = @{ @"errCode": @(r.errCode) }.mutableCopy;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
body[@"type"] = @(r.type);
body[@"returnKey"] = r.returnKey;
body[@"returnKey"] =r.returnKey;
body[@"type"] = @"PayReq.Resp";
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
} else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]) {
} else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]){
WXLaunchMiniProgramResp *r = (WXLaunchMiniProgramResp *)resp;
NSMutableDictionary *body = @{ @"errCode": @(r.errCode) }.mutableCopy;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
body[@"extMsg"] = r.extMsg;
body[@"type"] = @"WXLaunchMiniProgramReq.Resp";
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
} else if ([resp isKindOfClass:[WXChooseInvoiceResp class]]) {
} else if ([resp isKindOfClass:[WXChooseInvoiceResp class]]){
WXChooseInvoiceResp *r = (WXChooseInvoiceResp *)resp;
NSMutableDictionary *body = @{ @"errCode": @(r.errCode) }.mutableCopy;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
NSMutableArray *arr = [[NSMutableArray alloc] init];
for (WXCardItem *cardItem in r.cardAry) {
NSMutableDictionary *item = @{ @"cardId": cardItem.cardId, @"encryptCode": cardItem.encryptCode, @"appId": cardItem.appID }.mutableCopy;
for (WXCardItem* cardItem in r.cardAry) {
NSMutableDictionary *item = @{@"cardId":cardItem.cardId,@"encryptCode":cardItem.encryptCode,@"appId":cardItem.appID}.mutableCopy;
[arr addObject:item];
}
body[@"cards"] = arr;
@ -637,72 +643,4 @@ RCT_EXPORT_METHOD(openCustomerServiceChat
}
}
- (WXMiniProgramType)integerToWXMiniProgramType:(int)value {
WXMiniProgramType type = WXMiniProgramTypeRelease;
switch (value) {
case 0:
type = WXMiniProgramTypeRelease;
break;
case 1:
type = WXMiniProgramTypeTest;
break;
case 2:
type = WXMiniProgramTypePreview;
break;
}
return type;
}
#pragma mark - WechatAuthAPIDelegate
RCT_EXPORT_METHOD(addListener:(NSString *)eventName) {
}
RCT_EXPORT_METHOD(removeListeners:(double)count) {
}
RCT_EXPORT_METHOD(authByScan:(NSString *)appid
nonceStr:(NSString *)nonceStr
timeStamp:(NSString *)timeStamp
scope:(NSString *)scope
signature:(NSString *)signature
schemeData:(nullable NSString *)schemeData
callback:(RCTResponseSenderBlock)callback) {
self.scanCallback = callback;
[self.authSDK StopAuth];
[self.authSDK Auth:appid nonceStr:nonceStr timeStamp:timeStamp scope:scope signature:signature schemeData:schemeData];
}
//
- (void)onAuthGotQrcode:(UIImage *)image {
NSLog(@"onAuthGotQrcode");
NSData *imageData = UIImagePNGRepresentation(image);
if (!imageData) {
imageData = UIImageJPEGRepresentation(image, 1);
}
NSString *base64String = [imageData base64EncodedStringWithOptions:0];
[self.bridge.eventDispatcher sendDeviceEventWithName:@"onAuthGotQrcode" body:@{@"qrcode": base64String}];
}
//
- (void)onQrcodeScanned {
NSLog(@"onQrcodeScanned");
}
//
- (void)onAuthFinish:(int)errCode AuthCode:(nullable NSString *)authCode {
NSLog(@"onAuthFinish");
if (self.scanCallback) {
self.scanCallback(@[[NSNull null], @{@"authCode": authCode?:@"", @"errCode": @(errCode)}]);
self.scanCallback = nil;
}
}
- (NSArray<NSString *> *)supportedEvents
{
return @[@"onAuthGotQrcode", @"onQrcodeScanned", @"onAuthFinish"];
}
@end

View File

@ -7,7 +7,7 @@
#
Pod::Spec.new do |s|
s.name = "WeChatLib"
s.name = "RCTWeChat"
s.version = package['version']
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment"
@ -25,7 +25,7 @@ Pod::Spec.new do |s|
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "weflex" => "fox@sfxh.cc" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/little-snow-fox/react-native-wechat-lib.git", :tag => "master" }
s.source = { :git => "https://github.com/weflex/react-native-wechat.git", :tag => "master" }
s.source_files = "**/*.{h,m}"
s.requires_arc = true

View File

@ -0,0 +1,614 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
10D6D7A71F160C250066F0F3 /* RCTWeChatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 10D6D7A61F160C250066F0F3 /* RCTWeChatTests.m */; };
10D6D7A91F160C250066F0F3 /* libRCTWeChat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 86D238421BD0BB9E00C75D01 /* libRCTWeChat.a */; };
10D6D7AF1F160C3A0066F0F3 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 10D6D76D1F160B090066F0F3 /* libReact.a */; };
86D238561BD0BC1000C75D01 /* RCTWeChat.m in Sources */ = {isa = PBXBuildFile; fileRef = 86D238551BD0BC1000C75D01 /* RCTWeChat.m */; };
86D2385D1BD0CA3D00C75D01 /* libWeChatSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 86D238571BD0BC2200C75D01 /* libWeChatSDK.a */; settings = {ATTRIBUTES = (Required, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
10D6D76C1F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
remoteInfo = React;
};
10D6D76E1F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2D2A28131D9B038B00D4039D;
remoteInfo = "React-tvOS";
};
10D6D7701F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3C059A1DE3340900C268FA;
remoteInfo = yoga;
};
10D6D7721F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3C06751DE3340C00C268FA;
remoteInfo = "yoga-tvOS";
};
10D6D7741F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;
remoteInfo = cxxreact;
};
10D6D7761F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;
remoteInfo = "cxxreact-tvOS";
};
10D6D7781F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;
remoteInfo = jschelpers;
};
10D6D77A1F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
remoteInfo = "jschelpers-tvOS";
};
10D6D77C1F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
remoteInfo = "third-party";
};
10D6D77E1F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
remoteInfo = "third-party-tvOS";
};
10D6D7801F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 139D7E881E25C6D100323FB7;
remoteInfo = "double-conversion";
};
10D6D7821F160B090066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
remoteInfo = "double-conversion-tvOS";
};
10D6D7AA1F160C250066F0F3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 86D2383A1BD0BB9E00C75D01 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 86D238411BD0BB9E00C75D01;
remoteInfo = RCTWeChat;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
86D238401BD0BB9E00C75D01 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
10D6D75D1F160B090066F0F3 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
10D6D7A41F160C250066F0F3 /* RCTWeChatTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTWeChatTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
10D6D7A61F160C250066F0F3 /* RCTWeChatTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTWeChatTests.m; sourceTree = "<group>"; };
10D6D7A81F160C250066F0F3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
86D238421BD0BB9E00C75D01 /* libRCTWeChat.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWeChat.a; sourceTree = BUILT_PRODUCTS_DIR; };
86D238541BD0BC1000C75D01 /* RCTWeChat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWeChat.h; sourceTree = SOURCE_ROOT; };
86D238551BD0BC1000C75D01 /* RCTWeChat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWeChat.m; sourceTree = SOURCE_ROOT; };
86D238571BD0BC2200C75D01 /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = "<group>"; };
86D238581BD0BC2200C75D01 /* WXApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApi.h; sourceTree = "<group>"; };
86D238591BD0BC2200C75D01 /* WXApiObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiObject.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
10D6D7A11F160C250066F0F3 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
10D6D7AF1F160C3A0066F0F3 /* libReact.a in Frameworks */,
10D6D7A91F160C250066F0F3 /* libRCTWeChat.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
86D2383F1BD0BB9E00C75D01 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
86D2385D1BD0CA3D00C75D01 /* libWeChatSDK.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
10D6D75E1F160B090066F0F3 /* Products */ = {
isa = PBXGroup;
children = (
10D6D76D1F160B090066F0F3 /* libReact.a */,
10D6D76F1F160B090066F0F3 /* libReact.a */,
10D6D7711F160B090066F0F3 /* libyoga.a */,
10D6D7731F160B090066F0F3 /* libyoga.a */,
10D6D7751F160B090066F0F3 /* libcxxreact.a */,
10D6D7771F160B090066F0F3 /* libcxxreact.a */,
10D6D7791F160B090066F0F3 /* libjschelpers.a */,
10D6D77B1F160B090066F0F3 /* libjschelpers.a */,
10D6D77D1F160B090066F0F3 /* libthird-party.a */,
10D6D77F1F160B090066F0F3 /* libthird-party.a */,
10D6D7811F160B090066F0F3 /* libdouble-conversion.a */,
10D6D7831F160B090066F0F3 /* libdouble-conversion.a */,
);
name = Products;
sourceTree = "<group>";
};
10D6D7A51F160C250066F0F3 /* RCTWeChatTests */ = {
isa = PBXGroup;
children = (
10D6D7A61F160C250066F0F3 /* RCTWeChatTests.m */,
10D6D7A81F160C250066F0F3 /* Info.plist */,
);
path = RCTWeChatTests;
sourceTree = "<group>";
};
86D238391BD0BB9E00C75D01 = {
isa = PBXGroup;
children = (
86D238571BD0BC2200C75D01 /* libWeChatSDK.a */,
86D238581BD0BC2200C75D01 /* WXApi.h */,
86D238591BD0BC2200C75D01 /* WXApiObject.h */,
86D238441BD0BB9E00C75D01 /* RCTWeChat */,
10D6D7A51F160C250066F0F3 /* RCTWeChatTests */,
86D238431BD0BB9E00C75D01 /* Products */,
10D6D75D1F160B090066F0F3 /* React.xcodeproj */,
);
sourceTree = "<group>";
};
86D238431BD0BB9E00C75D01 /* Products */ = {
isa = PBXGroup;
children = (
86D238421BD0BB9E00C75D01 /* libRCTWeChat.a */,
10D6D7A41F160C250066F0F3 /* RCTWeChatTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
86D238441BD0BB9E00C75D01 /* RCTWeChat */ = {
isa = PBXGroup;
children = (
86D238541BD0BC1000C75D01 /* RCTWeChat.h */,
86D238551BD0BC1000C75D01 /* RCTWeChat.m */,
);
path = RCTWeChat;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
10D6D7A31F160C250066F0F3 /* RCTWeChatTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 10D6D7AC1F160C250066F0F3 /* Build configuration list for PBXNativeTarget "RCTWeChatTests" */;
buildPhases = (
10D6D7A01F160C250066F0F3 /* Sources */,
10D6D7A11F160C250066F0F3 /* Frameworks */,
10D6D7A21F160C250066F0F3 /* Resources */,
);
buildRules = (
);
dependencies = (
10D6D7AB1F160C250066F0F3 /* PBXTargetDependency */,
);
name = RCTWeChatTests;
productName = RCTWeChatTests;
productReference = 10D6D7A41F160C250066F0F3 /* RCTWeChatTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
86D238411BD0BB9E00C75D01 /* RCTWeChat */ = {
isa = PBXNativeTarget;
buildConfigurationList = 86D2384B1BD0BB9E00C75D01 /* Build configuration list for PBXNativeTarget "RCTWeChat" */;
buildPhases = (
86D2383E1BD0BB9E00C75D01 /* Sources */,
86D2383F1BD0BB9E00C75D01 /* Frameworks */,
86D238401BD0BB9E00C75D01 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = RCTWeChat;
productName = RCTWeChat;
productReference = 86D238421BD0BB9E00C75D01 /* libRCTWeChat.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
86D2383A1BD0BB9E00C75D01 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = WeFlex;
TargetAttributes = {
10D6D7A31F160C250066F0F3 = {
CreatedOnToolsVersion = 8.3.2;
DevelopmentTeam = QMP96B5DPW;
ProvisioningStyle = Automatic;
};
86D238411BD0BB9E00C75D01 = {
CreatedOnToolsVersion = 7.0;
DevelopmentTeam = JP4369ZCVM;
};
};
};
buildConfigurationList = 86D2383D1BD0BB9E00C75D01 /* Build configuration list for PBXProject "RCTWeChat" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 86D238391BD0BB9E00C75D01;
productRefGroup = 86D238431BD0BB9E00C75D01 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 10D6D75E1F160B090066F0F3 /* Products */;
ProjectRef = 10D6D75D1F160B090066F0F3 /* React.xcodeproj */;
},
);
projectRoot = "";
targets = (
86D238411BD0BB9E00C75D01 /* RCTWeChat */,
10D6D7A31F160C250066F0F3 /* RCTWeChatTests */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
10D6D76D1F160B090066F0F3 /* libReact.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libReact.a;
remoteRef = 10D6D76C1F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D76F1F160B090066F0F3 /* libReact.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libReact.a;
remoteRef = 10D6D76E1F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D7711F160B090066F0F3 /* libyoga.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libyoga.a;
remoteRef = 10D6D7701F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D7731F160B090066F0F3 /* libyoga.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libyoga.a;
remoteRef = 10D6D7721F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D7751F160B090066F0F3 /* libcxxreact.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcxxreact.a;
remoteRef = 10D6D7741F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D7771F160B090066F0F3 /* libcxxreact.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcxxreact.a;
remoteRef = 10D6D7761F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D7791F160B090066F0F3 /* libjschelpers.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libjschelpers.a;
remoteRef = 10D6D7781F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D77B1F160B090066F0F3 /* libjschelpers.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libjschelpers.a;
remoteRef = 10D6D77A1F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D77D1F160B090066F0F3 /* libthird-party.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libthird-party.a";
remoteRef = 10D6D77C1F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D77F1F160B090066F0F3 /* libthird-party.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libthird-party.a";
remoteRef = 10D6D77E1F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D7811F160B090066F0F3 /* libdouble-conversion.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libdouble-conversion.a";
remoteRef = 10D6D7801F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
10D6D7831F160B090066F0F3 /* libdouble-conversion.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libdouble-conversion.a";
remoteRef = 10D6D7821F160B090066F0F3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
10D6D7A21F160C250066F0F3 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
10D6D7A01F160C250066F0F3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
10D6D7A71F160C250066F0F3 /* RCTWeChatTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
86D2383E1BD0BB9E00C75D01 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
86D238561BD0BC1000C75D01 /* RCTWeChat.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
10D6D7AB1F160C250066F0F3 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 86D238411BD0BB9E00C75D01 /* RCTWeChat */;
targetProxy = 10D6D7AA1F160C250066F0F3 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
10D6D7AD1F160C250066F0F3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = QMP96B5DPW;
INFOPLIST_FILE = RCTWeChatTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = snowfox.RCTWeChatTests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
10D6D7AE1F160C250066F0F3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = QMP96B5DPW;
INFOPLIST_FILE = RCTWeChatTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = snowfox.RCTWeChatTests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
86D238491BD0BB9E00C75D01 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
86D2384A1BD0BB9E00C75D01 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
86D2384C1BD0BB9E00C75D01 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../../React/**",
"$(SRCROOT)/../react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/Libraries/Image/**",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
86D2384D1BD0BB9E00C75D01 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../../React/**",
"$(SRCROOT)/../react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/Libraries/Image/**",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
10D6D7AC1F160C250066F0F3 /* Build configuration list for PBXNativeTarget "RCTWeChatTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
10D6D7AD1F160C250066F0F3 /* Debug */,
10D6D7AE1F160C250066F0F3 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
86D2383D1BD0BB9E00C75D01 /* Build configuration list for PBXProject "RCTWeChat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
86D238491BD0BB9E00C75D01 /* Debug */,
86D2384A1BD0BB9E00C75D01 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
86D2384B1BD0BB9E00C75D01 /* Build configuration list for PBXNativeTarget "RCTWeChat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
86D2384C1BD0BB9E00C75D01 /* Debug */,
86D2384D1BD0BB9E00C75D01 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 86D2383A1BD0BB9E00C75D01 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:RCTWeChat.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,10 +14,10 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "WechatLibExample.app"
BlueprintName = "WechatLibExample"
ReferencedContainer = "container:WechatLibExample.xcodeproj">
BlueprintIdentifier = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@ -28,17 +28,18 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "WechatLibExampleTests.xctest"
BlueprintName = "WechatLibExampleTests"
ReferencedContainer = "container:WechatLibExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@ -50,16 +51,17 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "WechatLibExample.app"
BlueprintName = "WechatLibExample"
ReferencedContainer = "container:WechatLibExample.xcodeproj">
BlueprintIdentifier = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@ -67,16 +69,15 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "WechatLibExample.app"
BlueprintName = "WechatLibExample"
ReferencedContainer = "container:WechatLibExample.xcodeproj">
BlueprintIdentifier = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "10D6D7A31F160C250066F0F3"
BuildableName = "RCTWeChatTests.xctest"
BlueprintName = "RCTWeChatTests"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "10D6D7A31F160C250066F0F3"
BuildableName = "RCTWeChatTests.xctest"
BlueprintName = "RCTWeChatTests"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "10D6D7A31F160C250066F0F3"
BuildableName = "RCTWeChatTests.xctest"
BlueprintName = "RCTWeChatTests"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "10D6D7A31F160C250066F0F3"
BuildableName = "RCTWeChatTests.xctest"
BlueprintName = "RCTWeChatTests"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "NODE_ENV"
value = "test"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "10D6D7A31F160C250066F0F3"
BuildableName = "RCTWeChatTests.xctest"
BlueprintName = "RCTWeChatTests"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,31 @@
#import <XCTest/XCTest.h>
@interface RCTWeChatTests : XCTestCase
@end
@implementation RCTWeChatTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end

View File

@ -1,34 +1,4 @@
重要!
SDK2.0.0
1. 分享能力支持内容防篡改校验
SDK1.9.9
1. 授权登录支持关闭自动授权
2. 分享支持添加签名,防止篡改
SDK1.9.7
1. 适配CocoaPods
SDK1.9.6
1. 适配iOS 16减少读写剪切板
SDK1.9.4
1. 修复授权登录取消/拒绝时state字段没有带回
SDK1.9.3
1. 新增发起二维码支付能力
SDK1.9.2
1. 新增发起企微客服会话能力
SDK1.9.1
1. 音乐视频分享类型增加运营H5字段
SDK1.8.9
1. 增加音乐视频分享类型
SDK1.8.8
1. 增加游戏直播消息类型
SDK1.8.7.1
1. 修复Xcode11以下编译不通过

View File

@ -11,10 +11,6 @@
NS_ASSUME_NONNULL_BEGIN
typedef BOOL(^WXGrantReadPasteBoardPermissionCompletion)(void);
#pragma mark - WXApiDelegate
/*! @brief 接收并处理来自微信终端程序的事件消息
*
@ -42,17 +38,6 @@ typedef BOOL(^WXGrantReadPasteBoardPermissionCompletion)(void);
*/
- (void)onResp:(BaseResp*)resp;
/* ! @brief 用于在iOS16以及以上系统上控制OpenSDK是否读取剪切板中微信传递的数据以及读取的时机
* iOS16以及以上系统SDK需要读取剪切板中微信写入的数据时
*
* 1. iOS16以及以上的系统版本上回调;
* 2. OpenSDK会直接调用读取剪切板接口;
* 3. completion(), SDK允许读取剪切板中微信传递的数据,
* completion()OpenSDK读取剪切板onReq:, onResp:使
* 4. completion不释放
*/
- (void)onNeedGrantReadPasteBoardPermissionWithURL:(nonnull NSURL *)openURL completion:(nonnull WXGrantReadPasteBoardPermissionCompletion)completion;
@end
#pragma mark - WXApiLogDelegate
@ -118,24 +103,6 @@ typedef BOOL(^WXGrantReadPasteBoardPermissionCompletion)(void);
+ (BOOL)isWXAppSupportApi;
/*! @brief 判断当前微信的版本是否支持分享微信状态功能
*
* @attention LSApplicationQueriesSchemes配置中添加weixinStateAPI
* @return YESNO
*/
+ (BOOL)isWXAppSupportStateAPI;
#ifndef BUILD_WITHOUT_PAY
/*! @brief 判断当前微信的版本是否支持二维码拉起微信支付
*
* @attention LSApplicationQueriesSchemes配置中添加weixinQRCodePayAPI
* @return YESNO
*/
+ (BOOL)isWXAppSupportQRCodePayAPI;
#endif
/*! @brief 获取微信的itunes安装地址
*

View File

@ -33,7 +33,6 @@ enum WXScene {
WXSceneTimeline = 1, /**< 朋友圈 */
WXSceneFavorite = 2, /**< 收藏 */
WXSceneSpecifiedSession = 3, /**< 指定联系人 */
WXSceneState = 4, /**< 状态 */
};
@ -248,23 +247,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
@end
#pragma mark - WXQRCodePayReq
@interface WXQRCodePayReq : BaseReq
/** 码内容
* @note 010K
*/
@property (nonatomic, copy) NSString *codeContent;
/** 额外信息
* @note 010K
*/
@property (nonatomic, copy) NSString *extraMsg;
@end
@interface WXQRCodePayResp : BaseResp
@end
#endif
@ -286,15 +268,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
*/
@property (nonatomic, copy) NSString *state;
@property (nonatomic, assign) BOOL isOption1;
/** 是否关闭自动授权
* @note YES为关闭自动授权NO为允许自动授权
*/
@property (nonatomic, assign) BOOL nonautomatic;
@property (nonatomic, copy) NSString *extData;
@end
#pragma mark - SendAuthResp
@ -308,99 +281,13 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
@property (nonatomic, copy, nullable) NSString *code;
/** 第三方程序发送时用来标识其请求的唯一性的标志由第三方程序调用sendReq时传入由微信终端回传
* @note state字符串长度不能超过1K
* @note
* SendAuthResp的内容
* SendAuthResp.state符合预期时
*/
@property (nonatomic, copy, nullable) NSString *state;
@property (nonatomic, copy, nullable) NSString *lang;
@property (nonatomic, copy, nullable) NSString *country;
@end
#pragma mark - WXStateJumpInfo
/*! @brief 状态发表时的小尾巴跳转信息
*/
@interface WXStateJumpInfo : NSObject
@end
#pragma mark - WXStateJumpUrlInfo
/*! @brief 状态小尾巴跳转指定url的信息
*/
@interface WXStateJumpUrlInfo : WXStateJumpInfo
/** 跳转到指定的url
* @note url长度必须大于0且小于10K
*/
@property (nonatomic, copy) NSString *url;
@end
#pragma mark - WXStateJumpWXMiniProgramInfo
/*! @brief 状态小尾巴跳转指定小程序的信息
*/
@interface WXStateJumpMiniProgramInfo : WXStateJumpInfo
/** 小程序username
* @note
*/
@property (nonatomic, copy) NSString *username;
/** 小程序页面的路径
* @attention
*/
@property (nonatomic, copy, nullable) NSString *path;
/** 分享小程序的版本
* @attention
*/
@property (nonatomic, assign) WXMiniProgramType miniProgramType;
@end
#pragma mark - WXStateJumpWXMiniProgramInfo
/*! @brief 状态小尾巴跳转指定视频号主页信息
*/
@interface WXStateJumpChannelProfileInfo : WXStateJumpInfo
/** 视频号username
* @note username长度必须大于0且小于1K
*/
@property (nonatomic, copy) NSString *username;
@end
#pragma mark - WXStateSceneDataObject
/*! @brief 场景类型额外参数基类
*/
@interface WXSceneDataObject : NSObject
@end
#pragma mark - WXStateSceneDataObject
/*! @brief 状态场景类型
* WXStateSceneDataObject参数后
*/
@interface WXStateSceneDataObject : WXSceneDataObject
/** 状态标志的ID
* @note 10K
*/
@property (nonatomic, copy) NSString *stateId;
/** 状态发表时附带的文本描述
* @note 10K
*/
@property (nonatomic, copy) NSString *stateTitle;
/** 后台校验token
* @note 10K
*/
@property (nonatomic, copy) NSString *token;
/** 小尾巴跳转所需的信息
* @note url跳转
*/
@property (nonatomic, strong) WXStateJumpInfo *stateJumpDataInfo;
@end
#pragma mark - SendMessageToWXReq
/*! @brief 第三方程序发送消息至微信终端程序的消息结构体
@ -428,11 +315,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
* @note WXSceneSpecifiedSession时有效
*/
@property (nonatomic, copy, nullable) NSString *toUserOpenId;
/** 目标场景附带信息
* @note
*/
@property (nonatomic, strong) WXSceneDataObject *sceneDataObject;
@end
#pragma mark - SendMessageToWXResp
@ -810,21 +692,10 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
*/
@property (nonatomic, strong) id mediaObject;
/** 缩略图的hash值
* @note 使sha256得到
*/
@property (nonatomic, copy, nullable) NSString *thumbDataHash;
/** 消息签名
* @note
*/
@property (nonatomic, copy, nullable) NSString *msgSignature;
/*! @brief 设置消息缩略图的方法
*
* @param image
* @note 256K
* @note 64K
*/
- (void)setThumbImage:(UIImage *)image;
@ -851,22 +722,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
*/
@property (nonatomic, strong) NSData *imageData;
/** 图片数据的hash值
* @note 使sha256得到
*/
@property (nonatomic, copy, nullable) NSString *imgDataHash;
/** 分享的图片消息是否要带小程序入口,若 'entranceMiniProgramUsername' 非空则显示
*
* @note app图片消息
*/
@property (nonatomic, copy, nullable) NSString *entranceMiniProgramUsername;
/** 分享的图片消息显示的小程序入口可以跳转的小程序路径
* 'entranceMiniProgramUsername'
*/
@property (nonatomic, copy, nullable) NSString *entranceMiniProgramPath;
@end
@ -915,95 +770,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
#pragma mark - WXMusicVideoObject
@interface WXMusicVipInfo : NSObject
/**付费歌曲的id
* @note 32K
*/
@property (nonatomic, copy) NSString *musicId;
@end
@interface WXMusicVideoObject : NSObject
/*! @brief 返回一个WXMusicVideoObject对象
*
* @note WXMusicVideoObject对象是自动释放的
*/
+ (WXMusicVideoObject *)object;
/** 音乐网页的url地址
* @note 10K
*/
@property (nonatomic, copy) NSString *musicUrl;
/** 音乐数据url地址
* @note 10K
*/
@property (nonatomic, copy) NSString *musicDataUrl;
/**歌手名
* @note 1k
*/
@property (nonatomic, copy) NSString *singerName;
/**
* @note ,
*/
@property (nonatomic, assign) UInt32 duration;
/**歌词信息 LRC格式
* @note 32K
*/
@property (nonatomic, copy) NSString *songLyric;
/**高清封面图
* @note 1M
*/
@property (nonatomic, strong) NSData *hdAlbumThumbData;
/** 高清封面图数据的hash值
* @note 使sha256得到
*/
@property (nonatomic, copy, nullable) NSString *hdAlbumThumbFileHash;
/**音乐专辑名称
* @note 1k
*/
@property (nonatomic, copy, nullable) NSString *albumName;
/**音乐流派
* @note 1k
*/
@property (nonatomic, copy, nullable) NSString *musicGenre;
/**发行时间
* @note Unix时间戳
*/
@property (nonatomic, assign) UInt64 issueDate;
/**音乐标识符
* @note 1K
*/
@property (nonatomic, copy, nullable) NSString *identification;
/**运营H5地址
* @note H5
*/
@property (nonatomic, copy, nullable) NSString *musicOperationUrl;
/** 付费歌曲相关信息
* @note id等信息封装在内
*/
@property (nonatomic, strong) WXMusicVipInfo *musicVipInfo;
@end
#pragma mark - WXVideoObject
/*! @brief 多媒体消息中包含的视频数据对象
*
@ -1049,13 +815,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
*/
@property (nonatomic, copy) NSString *webpageUrl;
/**是否是私密消息
*/
@property (nonatomic, assign) BOOL isSecretMessage;
/** 业务所需的额外信息 */
@property (nonatomic, strong, nullable) NSDictionary *extraInfoDic;
@end
@ -1223,55 +982,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
/** 是否禁用转发 */
@property (nonatomic, assign) BOOL disableForward;
@property (nonatomic, assign) BOOL isUpdatableMessage;
@property (nonatomic, assign) BOOL isSecretMessage;
/** 业务所需的额外信息 */
@property (nonatomic, strong, nullable) NSDictionary *extraInfoDic;
@end
#pragma mark - WXGameLiveObject
/*! @brief WXGameLiveObject对象
*
* @note
*/
@interface WXGameLiveObject : NSObject
+ (WXGameLiveObject *)object;
/** 业务所需的额外信息 */
@property (nonatomic, strong, nullable) NSDictionary *extraInfoDic;
@end
@interface WXNativeGamePageObject : NSObject
/** 是否为视频类型
*/
@property (nonatomic, assign) BOOL isVideo;
/** 视频时长
@note
*/
@property (nonatomic, assign) UInt32 videoDuration;
/** 透传字段
@note 100K
*/
@property (nonatomic, copy) NSString *shareData;
/** 缩略图
@note 256K
*/
@property (nonatomic, strong) NSData *gameThumbData;
+ (WXNativeGamePageObject *)object;
@end
#pragma mark - WXLaunchMiniProgramReq
@ -1362,49 +1072,4 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
@property (nonatomic, copy, nullable) NSString *extMsg;
@end
#pragma mark - WXOpenCustomerServiceReq
@interface WXOpenCustomerServiceReq : BaseReq
+ (WXOpenCustomerServiceReq *)object;
/**企微客服发起流程 url
*/
@property (nonatomic, copy, nullable) NSString *url;
/**企业 id
*/
@property (nonatomic, copy, nullable) NSString *corpid;
@end
@interface WXOpenCustomerServiceResp : BaseResp
/** 业务返回数据
*/
@property (nonatomic, copy, nullable) NSString *extMsg;
@end
#pragma mark - WXChannelStartLiveReq
@interface WXChannelStartLiveReq : BaseReq
+ (WXChannelStartLiveReq *)object;
/** 必填直播业务数据json格式
*/
@property (nonatomic, copy) NSString *liveJsonInfo;
@end
@interface WXChannelStartLiveResp : BaseResp
/** 业务返回数据
*/
@property (nonatomic, copy, nullable) NSString *extMsg;
@end
NS_ASSUME_NONNULL_END

View File

@ -1,300 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
86D0366429A4BF3E00A01343 /* libWeChatSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 86D0365E29A4BF2600A01343 /* libWeChatSDK.a */; };
86D0366529A4BF5900A01343 /* WechatLib.mm in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* WechatLib.mm */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
58B511D91A9E6C8500147676 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libWechatLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWechatLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
86D0365D29A4BF2600A01343 /* WXApiObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiObject.h; sourceTree = "<group>"; };
86D0365E29A4BF2600A01343 /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = "<group>"; };
86D0365F29A4BF2700A01343 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
86D0366029A4BF2700A01343 /* WechatAuthSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WechatAuthSDK.h; sourceTree = "<group>"; };
86D0366129A4BF2700A01343 /* WXApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApi.h; sourceTree = "<group>"; };
B3E7B5881CC2AC0600A0062D /* WechatLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WechatLib.h; sourceTree = "<group>"; };
B3E7B5891CC2AC0600A0062D /* WechatLib.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WechatLib.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
58B511D81A9E6C8500147676 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
86D0366429A4BF3E00A01343 /* libWeChatSDK.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
134814211AA4EA7D00B7C361 /* Products */ = {
isa = PBXGroup;
children = (
134814201AA4EA6300B7C361 /* libWechatLib.a */,
);
name = Products;
sourceTree = "<group>";
};
58B511D21A9E6C8500147676 = {
isa = PBXGroup;
children = (
86D0365E29A4BF2600A01343 /* libWeChatSDK.a */,
86D0365F29A4BF2700A01343 /* README.txt */,
86D0366029A4BF2700A01343 /* WechatAuthSDK.h */,
86D0366129A4BF2700A01343 /* WXApi.h */,
86D0365D29A4BF2600A01343 /* WXApiObject.h */,
B3E7B5881CC2AC0600A0062D /* WechatLib.h */,
B3E7B5891CC2AC0600A0062D /* WechatLib.mm */,
134814211AA4EA7D00B7C361 /* Products */,
86D0366329A4BF3E00A01343 /* Frameworks */,
);
sourceTree = "<group>";
};
86D0366329A4BF3E00A01343 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
58B511DA1A9E6C8500147676 /* WechatLib */ = {
isa = PBXNativeTarget;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "WechatLib" */;
buildPhases = (
58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */,
58B511D91A9E6C8500147676 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = WechatLib;
productName = RCTDataManager;
productReference = 134814201AA4EA6300B7C361 /* libWechatLib.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
58B511D31A9E6C8500147676 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
58B511DA1A9E6C8500147676 = {
CreatedOnToolsVersion = 6.1.1;
};
};
};
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "WechatLib" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 58B511D21A9E6C8500147676;
productRefGroup = 58B511D21A9E6C8500147676;
projectDirPath = "";
projectRoot = "";
targets = (
58B511DA1A9E6C8500147676 /* WechatLib */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
58B511D71A9E6C8500147676 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
86D0366529A4BF5900A01343 /* WechatLib.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
58B511ED1A9E6C8500147676 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=*]" = arm64;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
58B511EE1A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=*]" = arm64;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
58B511F01A9E6C8500147676 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = WechatLib;
SKIP_INSTALL = YES;
};
name = Debug;
};
58B511F11A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = WechatLib;
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "WechatLib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511ED1A9E6C8500147676 /* Debug */,
58B511EE1A9E6C8500147676 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "WechatLib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511F01A9E6C8500147676 /* Debug */,
58B511F11A9E6C8500147676 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
}

Binary file not shown.

View File

@ -1,16 +0,0 @@
pre-commit:
parallel: true
commands:
lint:
files: git diff --name-only @{push}
glob: "*.{js,ts,jsx,tsx}"
run: npx eslint {files}
types:
files: git diff --name-only @{push}
glob: "*.{js,ts, jsx, tsx}"
run: npx tsc --noEmit
commit-msg:
parallel: true
commands:
commitlint:
run: npx commitlint --edit

34615
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,165 +1,38 @@
{
"name": "react-native-wechat-lib",
"version": "3.0.4",
"description": "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
"react-native": "src/index",
"source": "src/index",
"files": [
"src",
"lib",
"android",
"ios",
"cpp",
"*.podspec",
"!lib/typescript/example",
"!ios/build",
"!android/build",
"!android/gradle",
"!android/gradlew",
"!android/gradlew.bat",
"!android/local.properties",
"!**/__tests__",
"!**/__fixtures__",
"!**/__mocks__",
"!**/.*"
],
"version": "1.1.24",
"description": "react-native library for wechat app. 支持分享和拉起小程序。",
"main": "index.js",
"scripts": {
"test": "jest",
"typecheck": "tsc --noEmit",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"prepack": "bob build",
"release": "release-it",
"example": "yarn --cwd example",
"bootstrap": "yarn example && yarn install && yarn example pods",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
"test": "echo 1"
},
"repository": {
"type": "git",
"url": "https://github.com/little-snow-fox/react-native-wechat-lib.git"
},
"keywords": [
"wechat",
"react-native",
"ios",
"android"
"react",
"react-component",
"ios"
],
"dependencies": {
"events": "1.0.1"
},
"peerDependencies": {
"react-native": ">=0.40"
},
"author": "little-snow-fox <fox@sfxh.cc>",
"contributors": [
{
"name": "little-snow-fox",
"email": "fox@sfxh.cc"
}
],
"repository": "https://github.com/little-snow-fox/react-native-wechat-lib",
"author": "little-snow-fox <fox@aili.pro> (https://github.com/little-snow-fox)",
"license": "MIT",
"bugs": {
"url": "https://github.com/little-snow-fox/react-native-wechat-lib/issues"
},
"homepage": "https://github.com/little-snow-fox/react-native-wechat-lib#readme",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@commitlint/config-conventional": "^17.0.2",
"@evilmartians/lefthook": "^1.2.2",
"@react-native-community/eslint-config": "^3.0.2",
"@release-it/conventional-changelog": "^5.0.0",
"@types/jest": "^28.1.2",
"@types/react": "~17.0.21",
"@types/react-native": "0.70.0",
"commitlint": "^17.0.2",
"del-cli": "^5.0.0",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.1",
"pod-install": "^0.1.0",
"prettier": "^2.0.5",
"react": "18.1.0",
"react-native": "0.70.6",
"react-native-builder-bob": "^0.20.0",
"release-it": "^15.0.0",
"typescript": "^4.5.2",
"js-sha1": "^0.7.0"
},
"resolutions": {
"@types/react": "17.0.21"
},
"peerDependencies": {
"react": "*",
"react-native": "*",
"js-sha1": "*"
},
"engines": {
"node": ">= 16.0.0"
},
"packageManager": "^yarn@1.22.15",
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"release-it": {
"git": {
"commitMessage": "chore: release ${version}",
"tagName": "v${version}"
},
"npm": {
"publish": true
},
"github": {
"release": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular"
}
}
},
"eslintConfig": {
"root": true,
"extends": [
"@react-native-community",
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
]
}
},
"eslintIgnore": [
"node_modules/",
"lib/"
],
"prettier": {
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
},
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
[
"typescript",
{
"project": "tsconfig.build.json"
}
]
]
},
"dependencies": {
"events": "^3.3.0"
}
}
"homepage": "https://github.com/little-snow-fox/react-native-wechat-lib#readme"
}

6
playground/.buckconfig Normal file
View File

@ -0,0 +1,6 @@
[android]
target = Google Inc.:Google APIs:23
[maven_repositories]
central = https://repo1.maven.org/maven2

4
playground/.eslintrc.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};

Some files were not shown because too many files have changed in this diff Show More