feat init commit.

This commit is contained in:
snowfox 2019-10-26 00:16:04 +08:00
commit ec1dd8d221
98 changed files with 17591 additions and 0 deletions

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
.DS_Store
node_modules
/android/build
/android/RCTWeChat.iml
# ios
ios/build
# Xcode
build/
DerivedData/
xcuserdata
Pods/
*.xcuserstate
*.ipa
*.dSYM.zip
*.dSYM

7
.npmignore Normal file
View File

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

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

46
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
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 creating a positive environment include:
* 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 by participants include:
* 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 electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
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.
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 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 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.
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 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
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
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

27
RCTWeChat.podspec Normal file
View File

@ -0,0 +1,27 @@
#
# 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/
#
Pod::Spec.new do |s|
s.name = "RCTWeChat"
s.version = "1.9.12"
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}"
s.description = <<-DESC
React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}
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"
s.vendored_libraries = "ios/libWeChatSDK.a"
s.requires_arc = true
s.frameworks = 'SystemConfiguration','CoreTelephony'
s.library = 'sqlite3','c++','z'
end

340
README.md Normal file
View File

@ -0,0 +1,340 @@
<img height="200" src="./weixin.png?raw=true">
# React-Native-Wechat-Lib
[React Native] bridging library that integrates WeChat SDKs:
- [x] iOS SDK 1.8.6.1
- [x] Android SDK 5.5.6
## 前言
首先向各位声明,本库是在 [react-native-wechat](https://github.com/yorkie/react-native-wechat) 基础上进行重写。
本库已经向 react-native-wechat 提交合并请求[#526](https://github.com/yorkie/react-native-wechat/pull/526),但由于 react-native-wechat 所使用的 WeChat SDK 已经是几年前的版本,新 SDK 接口变动大,我修改的代码相当多,几乎重构了核心部分,导致合并需要耗费不小时间,再加上需要兼容正在使用旧版 SDK 的开发者,事情变得异常艰辛。
考虑到自身使用和其它开发者的需要,最终决定开一个新仓库,提供给新项目使用。
最后,感谢 [yorkie](https://github.com/yorkie) 和各位开发者为 react-native-wechat 做出的贡献。
## 目录
- [安装](#安装)
- [起步](#起步)
- [API 文档](#API文档)
## 安装
```sh
$ npm install react-native-wechat-lib --save
```
## 起步
- [iOS 安装](./docs/build-setup-ios.md)
- [Android 安装](./docs/build-setup-android.md)
## API文档
本库支持 `TypeScript`,使用 `Promise``async/await` 来接收返回。
接口名称和参数尽量跟腾讯官网保持一致性,除了嵌套对象变成扁平对象,你可以直接查看腾讯文档来获得更多帮助。
#### registerApp(appid) 注册
- `appid` {String} the appid you get from WeChat dashboard
- returns {Boolean} explains if your application is registered done
This method should be called once globally.
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.registerApp('appid', 'universalLink');
```
#### isWXAppInstalled() 判断微信是否已安装
- returns {Boolean} if WeChat is installed.
Check if the WeChat app is installed on the device.
#### isWXAppSupportApi() 检查支持情况
- returns {Boolean} Contains the result.
Check if wechat support open url.
#### getApiVersion() 获取API版本号
- returns {String} Contains the result.
Get the WeChat SDK api version.
#### openWXApp() 打开微信
- returns {Boolean}
Open the WeChat app from your application.
#### sendAuthRequest([scope[, state]]) 微信授权登录
- `scope` {Array|String} Scopes of auth request.
- `state` {String} the state of OAuth2
- returns {Object}
Send authentication request, and it returns an object with the
following fields:
| field | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | Error Code |
| errStr | String | Error message if any error occurred |
| openId | String | |
| code | String | Authorization code |
| url | String | The URL string |
| lang | String | The user language |
| country | String | The user country |
#### ShareText(ShareTextMetadata) 分享文本
ShareTextMetadata
| name | type | description |
|---------|--------|----------------------------------|
| text | String | 分享文本 |
| scene | Number | 分享到, 0:会话 2:朋友圈 3:收藏 |
Return:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.shareText({
text: 'Text content.',
scene: 0
})
```
#### ShareImage(ShareImageMetadata) 分享图片
ShareImageMetadata
| name | type | description |
|---------|--------|-------------------------------------|
| imageUrl| String | 图片地址 |
| scene | Number | 分享到, 0:会话 2:朋友圈 3:收藏 |
Return:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.shareImage({
imageUrl: 'https://google.com/1.jpg',
scene: 0
})
```
#### ShareMusic(ShareMusicMetadata) 分享音乐
ShareMusicMetadata
| name | type | description |
|---------------------|--------|-------------------------------|
| title | String | 标题 |
| description | String | 描述 |
| thumbImageUrl | String | 缩略图地址本库会自动压缩到32KB |
| musicUrl | String | 音频网页的URL地址 |
| musicLowBandUrl | String | 供低带宽环境下使用的音频网页URL地址 |
| musicDataUrl | String | 音频数据的URL地址 |
| musicLowBandDataUrl | String | 供低带宽环境下使用的音频数据URL地址 |
| scene | Number | 分享到, 0:会话 2:朋友圈 3:收藏 |
Return:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.shareMusic({
title: 'Good music.',
musicUrl: 'https://google.com/music.mp3',
thumbImageUrl: 'https://google.com/1.jpg',
scene: 0
})
```
#### ShareVideo(ShareVideoMetadata) 分享视频
ShareVideoMetadata
| name | type | description |
|---------|--------|-------------------------------------|
| title| String | 标题 |
| description| String | 描述 |
| thumbImageUrl| String | 缩略图地址本库会自动压缩到32KB |
| videoUrl| String | 视频链接 |
| videoLowBandUrl| String | 供低带宽的环境下使用的视频链接 |
| scene | Number | 分享到, 0:会话 2:朋友圈 3:收藏 |
Return:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.shareVideo({
title: 'Interesting video.',
videoUrl: 'https://google.com/music.mp3',
thumbImageUrl: 'https://google.com/1.jpg',
scene: 0
})
```
#### ShareWebpage (ShareWebpageMetadata) 分享网页
ShareWebpageMetadata
| name | type | description |
|---------|--------|-------------------------------------|
| title| String | 标题 |
| description| String | 描述 |
| thumbImageUrl| String | 缩略图地址本库会自动压缩到32KB |
| webpageUrl| String | HTML 链接 |
| scene | Number | 分享到, 0:会话 2:朋友圈 3:收藏 |
Return:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.shareWebpage({
title: 'Interesting web.',
videoUrl: 'https://google.com/music.mp3',
thumbImageUrl: 'https://google.com/1.jpg',
scene: 0
})
```
#### ShareMiniProgram(ShareMiniProgramMetadata) 分享小程序
ShareMiniProgram
| name | type | description |
|---------|--------|-------------------------------------|
| title| String | 标题 |
| description| String | 描述 |
| thumbImageUrl| String | 缩略图地址本库会自动压缩到32KB |
| userName| String | 小程序的 userName填小程序原始id |
| path| String | 小程序的页面路径 |
| hdImageUrl| String | 小程序新版本的预览图二进制数据6.5.9及以上版本微信客户端支持 |
| withShareTicket| String | 是否使用带shareTicket的分享 |
| miniProgramType| Number | 小程序的类型默认正式版1.8.1及以上版本开发者工具包支持分享开发版和体验版小程序 |
| webpageUrl| String | 兼容低版本的网页链接 |
| scene | Number | 分享到, 0:会话 2:朋友圈 3:收藏 |
Return:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.shareMiniProgram({
title: 'Mini program.',
userName: 'gh_d39d10000000',
webpageUrl: 'https://google.com/show.html',
thumbImageUrl: 'https://google.com/1.jpg',
scene: 0
})
```
#### LaunchMiniProgram (LaunchMiniProgramMetadata) 跳到小程序
LaunchMiniProgramMetadata
| name | type | description |
|---------|--------|-------------------------------------|
| userName| String | 填小程序原始id |
| miniProgramType| Number | 可选打开 开发版,体验版和正式版 |
| path| String | 拉起小程序页面的可带参路径,不填默认拉起小程序首页,对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar" |
Return:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
```js
import * as WeChat from 'react-native-wechat-lib';
WeChat.launchMiniProgram({
userName: 'gh_d39d10000000',
miniProgramType: 1
})
```
#### pay(payload) 支付
- `payload` {Object} the payment data
- `partnerId` {String} 商家向财付通申请的商家ID
- `prepayId` {String} 预支付订单ID
- `nonceStr` {String} 随机串
- `timeStamp` {String} 时间戳
- `package` {String} 商家根据财付通文档填写的数据和签名
- `sign` {String} 商家根据微信开放平台文档对数据做的签名
- returns {Object}
Sends request for proceeding payment, then returns an object:
| name | type | description |
|---------|--------|-------------------------------------|
| errCode | Number | 0 if authorization successed |
| errStr | String | Error message if any error occurred |
## License
MIT

1
_config.yml Normal file
View File

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

33
android/build.gradle Normal file
View File

@ -0,0 +1,33 @@
apply plugin: 'com.android.library'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 23)
buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 22)
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
}
allprojects {
repositories {
jcenter()
maven { url "$projectDir/../../react-native/android" }
}
}
dependencies {
api 'com.facebook.react:react-native:+'
api files('libs/libammsdk.jar')
// compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
}

BIN
android/libs/libammsdk.jar Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
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

@ -0,0 +1,800 @@
package com.theweflex.react;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import androidx.annotation.Nullable;
import com.facebook.common.executors.UiThreadImmediateExecutorService;
import com.facebook.common.internal.Files;
import com.facebook.common.references.CloseableReference;
import com.facebook.common.util.UriUtil;
import com.facebook.datasource.DataSource;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.common.ResizeOptions;
import com.facebook.imagepipeline.core.ImagePipeline;
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
import com.facebook.imagepipeline.image.CloseableImage;
import com.facebook.imagepipeline.request.ImageRequest;
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.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.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.modelmsg.SendMessageToWX;
import com.tencent.mm.opensdk.modelmsg.WXFileObject;
import com.tencent.mm.opensdk.modelmsg.WXImageObject;
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
import com.tencent.mm.opensdk.modelmsg.WXMiniProgramObject;
import com.tencent.mm.opensdk.modelmsg.WXMusicObject;
import com.tencent.mm.opensdk.modelmsg.WXTextObject;
import com.tencent.mm.opensdk.modelmsg.WXVideoObject;
import com.tencent.mm.opensdk.modelmsg.WXWebpageObject;
import com.tencent.mm.opensdk.modelpay.PayReq;
import com.tencent.mm.opensdk.modelpay.PayResp;
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.tencent.mm.opensdk.constants.ConstantsAPI;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.net.URI;
import java.util.ArrayList;
import java.util.UUID;
public class WeChatModule extends ReactContextBaseJavaModule implements IWXAPIEventHandler {
private String appId;
private IWXAPI api = null;
private final static String NOT_REGISTERED = "registerApp required.";
private final static String INVOKE_FAILED = "WeChat API invoke returns false.";
private final static String INVALID_ARGUMENT = "invalid argument.";
// 缩略图大小 kb
private final static int THUMB_SIZE = 32;
private static byte[] bitmapTopBytes(Bitmap bitmap) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
bitmap.recycle();
return baos.toByteArray();
}
private static byte[] bitmapResizeGetBytes(Bitmap image, int size) {
// 这个压缩算法存在效率问题希望有义士可以出手优化 by little-snow-fox 2019.10.20
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// 质量压缩方法这里100表示第一次不压缩把压缩后的数据缓存到 baos
image.compress(Bitmap.CompressFormat.JPEG, 100, baos);
int options = 10;
// 循环判断压缩后依然大于 32kb 则继续压缩
while (baos.toByteArray().length / 1024 > size) {
// 重置baos即清空baos
baos.reset();
// 每次都减少1
options += 1;
// 这里压缩options%把压缩后的数据存放到baos中
image.compress(Bitmap.CompressFormat.JPEG, 10 / options * 10, baos);
}
return baos.toByteArray();
}
public WeChatModule(ReactApplicationContext context) {
super(context);
}
@Override
public String getName() {
return "RCTWeChat";
}
/**
* fix Native module WeChatModule tried to override WeChatModule for module name RCTWeChat.
* If this was your intention, return true from WeChatModule#canOverrideExistingModule() bug
*
* @return
*/
public boolean canOverrideExistingModule() {
return true;
}
private static ArrayList<WeChatModule> modules = new ArrayList<>();
@Override
public void initialize() {
super.initialize();
modules.add(this);
}
@Override
public void onCatalystInstanceDestroy() {
super.onCatalystInstanceDestroy();
if (api != null) {
api = null;
}
modules.remove(this);
}
public static void handleIntent(Intent intent) {
for (WeChatModule mod : modules) {
mod.api.handleIntent(intent, mod);
}
}
@ReactMethod
public void registerApp(String appid, String universalLink, Callback callback) {
this.appId = appid;
api = WXAPIFactory.createWXAPI(this.getReactApplicationContext().getBaseContext(), appid, true);
callback.invoke(null, api.registerApp(appid));
}
@ReactMethod
public void isWXAppInstalled(Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
callback.invoke(null, api.isWXAppInstalled());
}
@ReactMethod
public void isWXAppSupportApi(Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
callback.invoke(null, api.getWXAppSupportAPI());
}
@ReactMethod
public void getApiVersion(Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
callback.invoke(null, api.getWXAppSupportAPI());
}
@ReactMethod
public void openWXApp(Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
callback.invoke(null, api.openWXApp());
}
@ReactMethod
public void sendAuthRequest(String scope, String state, Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
SendAuth.Req req = new SendAuth.Req();
req.scope = scope;
req.state = state;
callback.invoke(null, api.sendReq(req));
}
/**
* 分享文本
* @param data
* @param callback
*/
@ReactMethod
public void shareText(ReadableMap data, Callback callback) {
//初始化一个 WXTextObject 对象填写分享的文本内容
WXTextObject textObj = new WXTextObject();
textObj.text = data.getString("text");
// WXTextObject 对象初始化一个 WXMediaMessage 对象
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = textObj;
msg.description = data.getString("text");
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "text";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
/**
* 分享图片
* @param data
* @param callback
*/
@ReactMethod
public void shareImage(final ReadableMap data, final Callback callback) {
this._getImage(Uri.parse(data.getString("imageUrl")), null, new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bmp) {
// 初始化 WXImageObject WXMediaMessage 对象
WXImageObject imgObj = new WXImageObject(bmp);
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = imgObj;
// 设置缩略图
msg.thumbData = bitmapResizeGetBytes(bmp, THUMB_SIZE);
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "img";
req.message = msg;
// req.userOpenId = getOpenId();
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
});
}
/**
* 分享音乐
* @param data
* @param callback
*/
@ReactMethod
public void shareMusic(final ReadableMap data, final Callback callback) {
// 初始化一个WXMusicObject填写url
WXMusicObject music = new WXMusicObject();
music.musicUrl = data.hasKey("musicUrl") ? data.getString("musicUrl") : null;
music.musicLowBandUrl = data.hasKey("musicLowBandUrl") ? data.getString("musicLowBandUrl") : null;
music.musicDataUrl = data.hasKey("musicDataUrl") ? data.getString("musicDataUrl") : null;
music.musicUrl = data.hasKey("musicUrl") ? data.getString("musicUrl") : null;
music.musicLowBandDataUrl = data.hasKey("musicLowBandDataUrl") ? data.getString("musicLowBandDataUrl") : null;
// WXMusicObject 对象初始化一个 WXMediaMessage 对象
final WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = music;
msg.title = data.hasKey("title") ? data.getString("title") : null;
msg.description = data.hasKey("description") ? data.getString("description") : null;
if (data.hasKey("thumbImageUrl")) {
this._getImage(Uri.parse(data.getString("thumbImageUrl")), null, new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bmp) {
// 设置缩略图
msg.thumbData = bitmapResizeGetBytes(bmp, THUMB_SIZE);
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "music";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
});
} else {
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "music";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
}
/**
* 分享视频
* @param data
* @param callback
*/
@ReactMethod
public void shareVideo(final ReadableMap data, final Callback callback) {
// 初始化一个WXVideoObject填写url
WXVideoObject video = new WXVideoObject();
video.videoUrl = data.hasKey("videoUrl") ? data.getString("videoUrl") : null;
video.videoLowBandUrl = data.hasKey("videoLowBandUrl") ? data.getString("videoLowBandUrl") : null;
// WXVideoObject 对象初始化一个 WXMediaMessage 对象
final WXMediaMessage msg = new WXMediaMessage(video);
msg.title = data.hasKey("title") ? data.getString("title") : null;
msg.description = data.hasKey("description") ? data.getString("description") : null;
if (data.hasKey("thumbImageUrl")) {
this._getImage(Uri.parse(data.getString("thumbImageUrl")), null, new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bmp) {
// 设置缩略图
msg.thumbData = bitmapResizeGetBytes(bmp, THUMB_SIZE);
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "video";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
});
} else {
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "video";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
}
/**
* 分享网页
* @param data
* @param callback
*/
@ReactMethod
public void shareWebpage(final ReadableMap data, final Callback callback) {
// 初始化一个WXWebpageObject填写url
WXWebpageObject webpage = new WXWebpageObject();
webpage.webpageUrl = data.hasKey("webpageUrl") ? data.getString("webpageUrl") : null;
// WXWebpageObject 对象初始化一个 WXMediaMessage 对象
final WXMediaMessage msg = new WXMediaMessage(webpage);
msg.title = data.hasKey("title") ? data.getString("title") : null;
msg.description = data.hasKey("description") ? data.getString("description") : null;
if (data.hasKey("thumbImageUrl")) {
this._getImage(Uri.parse(data.getString("thumbImageUrl")), null, new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bmp) {
// 设置缩略图
msg.thumbData = bitmapResizeGetBytes(bmp, THUMB_SIZE);
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "webpage";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
});
} else {
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "webpage";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
}
/**
* 分享小程序
* @param data
* @param callback
*/
@ReactMethod
public void shareMiniProgram(final ReadableMap data, final Callback callback) {
WXMiniProgramObject miniProgramObj = new WXMiniProgramObject();
// 兼容低版本的网页链接
miniProgramObj.webpageUrl = data.hasKey("webpageUrl") ? data.getString("webpageUrl") : null;
// 正式版:0测试版:1体验版:2
miniProgramObj.miniprogramType = data.hasKey("miniprogramType") ? data.getInt("miniprogramType") : WXMiniProgramObject.MINIPTOGRAM_TYPE_RELEASE;
// 小程序原始id
miniProgramObj.userName = data.hasKey("userName") ? data.getString("userName") : null;
// 小程序页面路径对于小游戏可以只传入 query 部分来实现传参效果传入 "?foo=bar"
miniProgramObj.path = data.hasKey("path") ? data.getString("path") : null;
final WXMediaMessage msg = new WXMediaMessage(miniProgramObj);
// 小程序消息 title
msg.title = data.hasKey("title") ? data.getString("title") : null;
// 小程序消息 desc
msg.description = data.hasKey("description") ? data.getString("description") : null;
String thumbImageUrl = data.hasKey("hdImageUrl") ? data.getString("hdImageUrl") : data.hasKey("thumbImageUrl") ? data.getString("thumbImageUrl") : null;
if (thumbImageUrl != null && !thumbImageUrl.equals("")) {
this._getImage(Uri.parse(thumbImageUrl), null, new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bmp) {
// 小程序消息封面图片小于128k
msg.thumbData = bitmapResizeGetBytes(bmp, 128);
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "miniProgram";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
});
} else {
// 构造一个Req
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "miniProgram";
req.message = msg;
req.scene = data.hasKey("scene") ? data.getInt("scene") : SendMessageToWX.Req.WXSceneSession;
callback.invoke(null, api.sendReq(req));
}
}
@ReactMethod
public void shareToTimeline(ReadableMap data, Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
_share(SendMessageToWX.Req.WXSceneTimeline, data, callback);
}
@ReactMethod
public void launchMiniProgram(ReadableMap data, Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
// 填小程序原始id
req.userName = data.getString("userName");
//拉起小程序页面的可带参路径不填默认拉起小程序首页
req.path = data.getString("path");
// 可选打开 开发版体验版和正式版
req.miniprogramType = data.getInt("miniProgramType");
boolean success = api.sendReq(req);
if (!success) callback.invoke(INVALID_ARGUMENT);
}
@ReactMethod
public void shareToSession(ReadableMap data, Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
_share(SendMessageToWX.Req.WXSceneSession, data, callback);
}
@ReactMethod
public void shareToFavorite(ReadableMap data, Callback callback) {
if (api == null) {
callback.invoke(NOT_REGISTERED);
return;
}
_share(SendMessageToWX.Req.WXSceneFavorite, data, callback);
}
@ReactMethod
public void pay(ReadableMap data, Callback callback) {
PayReq payReq = new PayReq();
if (data.hasKey("partnerId")) {
payReq.partnerId = data.getString("partnerId");
}
if (data.hasKey("prepayId")) {
payReq.prepayId = data.getString("prepayId");
}
if (data.hasKey("nonceStr")) {
payReq.nonceStr = data.getString("nonceStr");
}
if (data.hasKey("timeStamp")) {
payReq.timeStamp = data.getString("timeStamp");
}
if (data.hasKey("sign")) {
payReq.sign = data.getString("sign");
}
if (data.hasKey("package")) {
payReq.packageValue = data.getString("package");
}
if (data.hasKey("extData")) {
payReq.extData = data.getString("extData");
}
payReq.appId = appId;
callback.invoke(api.sendReq(payReq) ? null : INVOKE_FAILED);
}
private void _share(final int scene, final ReadableMap data, final Callback callback) {
Uri uri = null;
if (data.hasKey("thumbImage")) {
String imageUrl = data.getString("thumbImage");
try {
uri = Uri.parse(imageUrl);
// Verify scheme is set, so that relative uri (used by static resources) are not handled.
if (uri.getScheme() == null) {
uri = getResourceDrawableUri(getReactApplicationContext(), imageUrl);
}
} catch (Exception e) {
// ignore malformed uri, then attempt to extract resource ID.
}
}
if (uri != null) {
this._getImage(uri, new ResizeOptions(100, 100), new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bitmap) {
WeChatModule.this._share(scene, data, bitmap, callback);
}
});
} else {
this._share(scene, data, null, callback);
}
}
private void _getImage(Uri uri, ResizeOptions resizeOptions, final ImageCallback imageCallback) {
BaseBitmapDataSubscriber dataSubscriber = new BaseBitmapDataSubscriber() {
@Override
protected void onNewResultImpl(Bitmap bitmap) {
if (bitmap != null) {
if (bitmap.getConfig() != null) {
bitmap = bitmap.copy(bitmap.getConfig(), true);
imageCallback.invoke(bitmap);
} else {
bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
imageCallback.invoke(bitmap);
}
} else {
imageCallback.invoke(null);
}
}
@Override
protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) {
imageCallback.invoke(null);
}
};
ImageRequestBuilder builder = ImageRequestBuilder.newBuilderWithSource(uri);
if (resizeOptions != null) {
builder = builder.setResizeOptions(resizeOptions);
}
ImageRequest imageRequest = builder.build();
ImagePipeline imagePipeline = Fresco.getImagePipeline();
DataSource<CloseableReference<CloseableImage>> dataSource = imagePipeline.fetchDecodedImage(imageRequest, null);
dataSource.subscribe(dataSubscriber, UiThreadImmediateExecutorService.getInstance());
}
private static Uri getResourceDrawableUri(Context context, String name) {
if (name == null || name.isEmpty()) {
return null;
}
name = name.toLowerCase().replace("-", "_");
int resId = context.getResources().getIdentifier(
name,
"drawable",
context.getPackageName());
if (resId == 0) {
return null;
} else {
return new Uri.Builder()
.scheme(UriUtil.LOCAL_RESOURCE_SCHEME)
.path(String.valueOf(resId))
.build();
}
}
private void _share(final int scene, final ReadableMap data, final Bitmap thumbImage, final Callback callback) {
if (!data.hasKey("type")) {
callback.invoke(INVALID_ARGUMENT);
return;
}
String type = data.getString("type");
WXMediaMessage.IMediaObject mediaObject = null;
if (type.equals("news")) {
mediaObject = _jsonToWebpageMedia(data);
} else if (type.equals("text")) {
mediaObject = _jsonToTextMedia(data);
} else if (type.equals("imageUrl") || type.equals("imageResource")) {
__jsonToImageUrlMedia(data, new MediaObjectCallback() {
@Override
public void invoke(@Nullable WXMediaMessage.IMediaObject mediaObject) {
if (mediaObject == null) {
callback.invoke(INVALID_ARGUMENT);
} else {
WeChatModule.this._share(scene, data, thumbImage, mediaObject, callback);
}
}
});
return;
} else if (type.equals("imageFile")) {
__jsonToImageFileMedia(data, new MediaObjectCallback() {
@Override
public void invoke(@Nullable WXMediaMessage.IMediaObject mediaObject) {
if (mediaObject == null) {
callback.invoke(INVALID_ARGUMENT);
} else {
WeChatModule.this._share(scene, data, thumbImage, mediaObject, callback);
}
}
});
return;
} else if (type.equals("video")) {
mediaObject = __jsonToVideoMedia(data);
} else if (type.equals("audio")) {
mediaObject = __jsonToMusicMedia(data);
} else if (type.equals("file")) {
mediaObject = __jsonToFileMedia(data);
}
if (mediaObject == null) {
callback.invoke(INVALID_ARGUMENT);
} else {
_share(scene, data, thumbImage, mediaObject, callback);
}
}
private void _share(int scene, ReadableMap data, Bitmap thumbImage, WXMediaMessage.IMediaObject mediaObject, Callback callback) {
WXMediaMessage message = new WXMediaMessage();
message.mediaObject = mediaObject;
if (thumbImage != null) {
message.setThumbImage(thumbImage);
}
if (data.hasKey("title")) {
message.title = data.getString("title");
}
if (data.hasKey("description")) {
message.description = data.getString("description");
}
if (data.hasKey("mediaTagName")) {
message.mediaTagName = data.getString("mediaTagName");
}
if (data.hasKey("messageAction")) {
message.messageAction = data.getString("messageAction");
}
if (data.hasKey("messageExt")) {
message.messageExt = data.getString("messageExt");
}
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.message = message;
req.scene = scene;
req.transaction = UUID.randomUUID().toString();
callback.invoke(null, api.sendReq(req));
}
private WXTextObject _jsonToTextMedia(ReadableMap data) {
if (!data.hasKey("description")) {
return null;
}
WXTextObject ret = new WXTextObject();
ret.text = data.getString("description");
return ret;
}
private WXWebpageObject _jsonToWebpageMedia(ReadableMap data) {
if (!data.hasKey("webpageUrl")) {
return null;
}
WXWebpageObject ret = new WXWebpageObject();
ret.webpageUrl = data.getString("webpageUrl");
if (data.hasKey("extInfo")) {
ret.extInfo = data.getString("extInfo");
}
return ret;
}
private void __jsonToImageMedia(String imageUrl, final MediaObjectCallback callback) {
Uri imageUri;
try {
imageUri = Uri.parse(imageUrl);
// Verify scheme is set, so that relative uri (used by static resources) are not handled.
if (imageUri.getScheme() == null) {
imageUri = getResourceDrawableUri(getReactApplicationContext(), imageUrl);
}
} catch (Exception e) {
imageUri = null;
}
if (imageUri == null) {
callback.invoke(null);
return;
}
this._getImage(imageUri, null, new ImageCallback() {
@Override
public void invoke(@Nullable Bitmap bitmap) {
callback.invoke(bitmap == null ? null : new WXImageObject(bitmap));
}
});
}
private void __jsonToImageUrlMedia(ReadableMap data, MediaObjectCallback callback) {
if (!data.hasKey("imageUrl")) {
callback.invoke(null);
return;
}
String imageUrl = data.getString("imageUrl");
__jsonToImageMedia(imageUrl, callback);
}
private void __jsonToImageFileMedia(ReadableMap data, MediaObjectCallback callback) {
if (!data.hasKey("imageUrl")) {
callback.invoke(null);
return;
}
String imageUrl = data.getString("imageUrl");
if (!imageUrl.toLowerCase().startsWith("file://")) {
imageUrl = "file://" + imageUrl;
}
__jsonToImageMedia(imageUrl, callback);
}
private WXMusicObject __jsonToMusicMedia(ReadableMap data) {
if (!data.hasKey("musicUrl")) {
return null;
}
WXMusicObject ret = new WXMusicObject();
ret.musicUrl = data.getString("musicUrl");
return ret;
}
private WXVideoObject __jsonToVideoMedia(ReadableMap data) {
if (!data.hasKey("videoUrl")) {
return null;
}
WXVideoObject ret = new WXVideoObject();
ret.videoUrl = data.getString("videoUrl");
return ret;
}
private WXFileObject __jsonToFileMedia(ReadableMap data) {
if (!data.hasKey("filePath")) {
return null;
}
return new WXFileObject(data.getString("filePath"));
}
// TODO: 实现sendRequestsendSuccessResponsesendErrorCommonResponsesendErrorUserCancelResponse
@Override
public void onReq(BaseReq baseReq) {
}
@Override
public void onResp(BaseResp baseResp) {
WritableMap map = Arguments.createMap();
map.putInt("errCode", baseResp.errCode);
map.putString("errStr", baseResp.errStr);
map.putString("openId", baseResp.openId);
map.putString("transaction", baseResp.transaction);
if (baseResp instanceof SendAuth.Resp) {
SendAuth.Resp resp = (SendAuth.Resp) (baseResp);
map.putString("type", "SendAuth.Resp");
map.putString("code", resp.code);
map.putString("state", resp.state);
map.putString("url", resp.url);
map.putString("lang", resp.lang);
map.putString("country", resp.country);
} else if (baseResp instanceof SendMessageToWX.Resp) {
SendMessageToWX.Resp resp = (SendMessageToWX.Resp) (baseResp);
map.putString("type", "SendMessageToWX.Resp");
} else if (baseResp instanceof PayResp) {
PayResp resp = (PayResp) (baseResp);
map.putString("type", "PayReq.Resp");
map.putString("returnKey", resp.returnKey);
} else if (baseResp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) {
WXLaunchMiniProgram.Resp resp = (WXLaunchMiniProgram.Resp) baseResp;
// 对应JsApi navigateBackApplication中的extraData字段数据
String extraData = resp.extMsg;
map.putString("extraData", extraData);
}
this.getReactApplicationContext()
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("WeChat_Resp", map);
}
private interface ImageCallback {
void invoke(@Nullable Bitmap bitmap);
}
private interface MediaObjectCallback {
void invoke(@Nullable WXMediaMessage.IMediaObject mediaObject);
}
}

View File

@ -0,0 +1,30 @@
package com.theweflex.react;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class WeChatPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.asList(new NativeModule[]{
// Modules from third-party
new WeChatModule(reactContext),
});
}
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}

114
docs/build-setup-android.md Normal file
View File

@ -0,0 +1,114 @@
# Build Setup for Android
Copy lines to `android/settings.gradle`:
```gradle
include ':RCTWeChat'
project(':RCTWeChat').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wechat/android')
```
Copy lines to `android/app/build.gradle`
```gradle
dependencies {
implementation project(':RCTWeChat') // Add this line
}
```
Copy lines to `proguard-rules.pro`:
```pro
-keep class com.tencent.mm.sdk.** {
*;
}
```
Then update `MainActivity.java` or `MainApplication.java`:
```java
import com.theweflex.react.WeChatPackage; // Add this line
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
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 WeChatPackage()); // Add this line
return packages;
}
```
**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.theweflex.react.WeChatModule;
public class WXEntryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WeChatModule.handleIntent(getIntent());
finish();
}
}
```
Then add the following node to `AndroidManifest.xml`:
```xml
<manifest>
<application>
<activity
android:name=".wxapi.WXEntryActivity"
android:label="@string/app_name"
android:exported="true"
/>
</application>
</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
`WXPayEntryActivity`, this is used to bypass the response to JS level:
```java
package your.package.wxapi;
import android.app.Activity;
import android.os.Bundle;
import com.theweflex.react.WeChatModule;
public class WXPayEntryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WeChatModule.handleIntent(getIntent());
finish();
}
}
```
Then add the following node to `AndroidManifest.xml`:
```xml
<manifest>
<application>
<activity
android:name=".wxapi.WXPayEntryActivity"
android:label="@string/app_name"
android:exported="true"
/>
</application>
</manifest>
```

76
docs/build-setup-ios.md Normal file
View File

@ -0,0 +1,76 @@
# Build Setup for iOS
## 1. Add the following libraries to your "Link Binary with Libraries" in Targets > Build Phases :
- [x] `WebKit.framework`
- [x] `SystemConfiguration.framework`
- [x] `CoreTelephony.framework`
- [x] `libsqlite3.0`
- [x] `libc++`
- [x] `libz`
Add "URL Schema" as your app id for "URL type" in Targets > info, See
the following screenshot for the view on your XCode:
![Set URL Schema in XCode](https://i.loli.net/2019/08/31/yUD2F5MrPKjngo3.jpg)
Cannot go back to APP from WeChat without configuration.
如果不配置就无法从微信重新回到APP。
</br>
</br>
On iOS 9+, add `wechat` and `weixin` into `LSApplicationQueriesSchemes` in
`Targets` > `info` > `Custom iOS Target Properties`. Or edit `Info.plist`
then add:
```xml
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>wechat</string>
</array>
```
If not configured, apple will prevent you from jumping to WeChat due to security permissions.
如果不配置,因为安全权限问题,苹果会阻止你跳转到微信。
</br>
## 2. Then copy the following in `AppDelegate.m`:
wechat callback function, If not configured, When sharing is called, it appears "connecting" and then bounces back.
微信回调方法,如果不配置,分享的时候微信会出现"正在连接"然后直接弹回APP。
```objc
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [WXApi handleOpenURL:url delegate:self];
}
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable
restorableObjects))restorationHandler {
return [WXApi handleOpenUniversalLink:userActivity
delegate:self];
}
```
Universal Links config, If not used, please ignore.
Universal Links 配置文件, 没使用的话可以忽略。
```objc
#import <React/RCTLinkingManager.h>
// ios 8.x or older
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
[RCTLinkingManager application:application openURL:url options:options];
return [WXApi handleOpenURL:url delegate:self];
}
// ios 9.0+
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
options:(NSDictionary<NSString*, id> *)options
{
// Triggers a callback event.
// 触发回调事件
[RCTLinkingManager application:application openURL:url options:options];
return [WXApi handleOpenURL:url delegate:self];
}
```

134
index.d.ts vendored Normal file
View File

@ -0,0 +1,134 @@
/*! @brief
*
*/
enum WXScene {
WXSceneSession = 0, /**< 聊天界面 */
WXSceneTimeline = 1, /**< 朋友圈 */
WXSceneFavorite = 2, /**< 收藏 */
WXSceneSpecifiedSession = 3, /**< 指定联系人 */
};
declare module "react-native-wechat-lib" {
export function registerApp(appId: string, universalLink?: string): Promise<boolean>;
export function isWXAppInstalled(): Promise<boolean>;
export function isWXAppSupportApi(): Promise<boolean>;
export function getApiVersion(): Promise<string>;
export function openWXApp(): Promise<boolean>;
export interface AuthResponse {
errCode?: number;
errStr?: string;
openId?: string;
code?: string;
url?: string;
lang?: string;
country?: string;
}
export function sendAuthRequest(
scope: string | string[],
state?: string
): Promise<AuthResponse>;
export interface ShareMetadata {
type:
| "news"
| "text"
| "imageUrl"
| "imageFile"
| "imageResource"
| "video"
| "audio"
| "file";
thumbImage?: string;
description?: string;
webpageUrl?: string;
imageUrl?: string;
videoUrl?: string;
musicUrl?: string;
filePath?: string;
fileExtension?: string;
}
export interface ShareTextMetadata {
text: string,
scene?: WXScene
}
export interface ShareImageMetadata {
imageUrl: string,
scene?: WXScene
}
export interface ShareMusicMetadata {
musicUrl: string,
musicLowBandUrl?: string,
musicDataUrl?: string,
musicLowBandDataUrl?: string,
title?: string,
description?: string,
thumbImageUrl?: string,
scene?: WXScene
}
export interface ShareVideoMetadata {
videoUrl: string,
videoLowBandUrl?: string,
title?: string,
description?: string,
thumbImageUrl?: string,
scene?: WXScene
}
export interface ShareWebpageMetadata {
webpageUrl: string,
title?: string,
description?: string,
thumbImageUrl?: string,
scene?: WXScene
}
export interface ShareMiniProgramMetadata {
webpageUrl: string,
userName: string,
path?: string,
hdImageUrl?: string,
withShareTicket?: string,
miniProgramType?: number,
title?: string,
description?: string,
thumbImageUrl?: string,
scene?: WXScene
}
export interface LaunchMiniProgramMetadata {
userName: string,
miniProgramType?: number,
path?: string
}
export function shareText(
message: ShareTextMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function shareImage(
message: ShareImageMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function shareMusic(
message: ShareMusicMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function shareVideo(
message: ShareVideoMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function shareWebpage(
message: ShareWebpageMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function shareMiniProgram(
message: ShareMiniProgramMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function shareToTimeline(
message: ShareMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function launchMiniProgram(
message: LaunchMiniProgramMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export interface PaymentLoad {
partnerId: string;
prepayId: string;
nonceStr: string;
timeStamp: string;
package: string;
sign: string;
}
export function pay(
payload: PaymentLoad
): Promise<{ errCode?: number; errStr?: string }>;
}

448
index.js Normal file
View File

@ -0,0 +1,448 @@
'use strict';
import { DeviceEventEmitter, NativeModules, Platform } from 'react-native';
import { EventEmitter } from 'events';
let isAppRegistered = false;
const { WeChat } = NativeModules;
// Event emitter to dispatch request and response from WeChat.
const emitter = new EventEmitter();
DeviceEventEmitter.addListener('WeChat_Resp', resp => {
emitter.emit(resp.type, resp);
});
DeviceEventEmitter.addListener('WeChat_Req', resp => {
emitter.emit(resp.type, resp);
});
function wrapRegisterApp(nativeFunc) {
if (!nativeFunc) {
return undefined;
}
return (...args) => {
if (isAppRegistered) {
return Promise.resolve(true);
}
isAppRegistered = true;
return new Promise((resolve, reject) => {
nativeFunc.apply(null, [
...args,
(error, result) => {
if (!error) {
return resolve(result);
}
if (typeof error === 'string') {
return reject(new Error(error));
}
reject(error);
},
]);
});
};
}
function wrapApi(nativeFunc) {
if (!nativeFunc) {
return undefined;
}
return (...args) => {
if (!isAppRegistered) {
return Promise.reject(new Error('registerApp required.'));
}
return new Promise((resolve, reject) => {
nativeFunc.apply(null, [
...args,
(error, result) => {
if (!error) {
return resolve(result);
}
if (typeof error === 'string') {
return reject(new Error(error));
}
reject(error);
},
]);
});
};
}
/**
* `addListener` inherits from `events` module
* @method addListener
* @param {String} eventName - the event name
* @param {Function} trigger - the function when event is fired
*/
export const addListener = emitter.addListener.bind(emitter);
/**
* `once` inherits from `events` module
* @method once
* @param {String} eventName - the event name
* @param {Function} trigger - the function when event is fired
*/
export const once = emitter.once.bind(emitter);
/**
* `removeAllListeners` inherits from `events` module
* @method removeAllListeners
* @param {String} eventName - the event name
*/
export const removeAllListeners = emitter.removeAllListeners.bind(emitter);
/**
* @method registerApp
* @param {String} appid - the app id
* @return {Promise}
*/
export const registerApp = wrapRegisterApp(WeChat.registerApp);
// /**
// * @method registerAppWithDescription
// * @param {String} appid - the app id
// * @param {String} appdesc - the app description
// * @return {Promise}
// */
// export const registerAppWithDescription = wrapRegisterApp(
// WeChat.registerAppWithDescription,
// );
/**
* Return if the wechat app is installed in the device.
* @method isWXAppInstalled
* @return {Promise}
*/
export const isWXAppInstalled = wrapApi(WeChat.isWXAppInstalled);
/**
* Return if the wechat application supports the api
* @method isWXAppSupportApi
* @return {Promise}
*/
export const isWXAppSupportApi = wrapApi(WeChat.isWXAppSupportApi);
/**
* Get the wechat app installed url
* @method getWXAppInstallUrl
* @return {String} the wechat app installed url
*/
export const getWXAppInstallUrl = wrapApi(WeChat.getWXAppInstallUrl);
/**
* Get the wechat api version
* @method getApiVersion
* @return {String} the api version string
*/
export const getApiVersion = wrapApi(WeChat.getApiVersion);
/**
* Open wechat app
* @method openWXApp
* @return {Promise}
*/
export const openWXApp = wrapApi(WeChat.openWXApp);
// wrap the APIs
const nativeShareToTimeline = wrapApi(WeChat.shareToTimeline);
const nativeLaunchMiniProgram = wrapApi(WeChat.launchMiniProgram);
const nativeShareToSession = wrapApi(WeChat.shareToSession);
const nativeShareToFavorite = wrapApi(WeChat.shareToFavorite);
const nativeSendAuthRequest = wrapApi(WeChat.sendAuthRequest);
const nativeShareText = wrapApi(WeChat.shareText);
const nativeShareImage = wrapApi(WeChat.shareImage);
const nativeShareMusic = wrapApi(WeChat.shareMusic);
const nativeShareVideo = wrapApi(WeChat.shareVideo);
const nativeShareWebpage = wrapApi(WeChat.shareWebpage);
const nativeShareMiniProgram = wrapApi(WeChat.shareMiniProgram);
/**
* @method sendAuthRequest
* @param {Array} scopes - the scopes for authentication.
* @return {Promise}
*/
export function sendAuthRequest(scopes, state) {
console.warn('sendAuthRequest')
return new Promise((resolve, reject) => {
WeChat.sendAuthRequest(scopes, state, () => {});
emitter.once('SendAuth.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share text
* @method shareText
* @param {Object} data
*/
export function shareText(data) {
return new Promise((resolve, reject) => {
nativeShareText(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share image
* @method shareImage
* @param {Object} data
*/
export function shareImage(data) {
return new Promise((resolve, reject) => {
nativeShareImage(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share music
* @method shareMusic
* @param {Object} data
*/
export function shareMusic(data) {
return new Promise((resolve, reject) => {
nativeShareMusic(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share video
* @method shareVideo
* @param {Object} data
*/
export function shareVideo(data) {
return new Promise((resolve, reject) => {
nativeShareVideo(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share webpage
* @method shareWebpage
* @param {Object} data
*/
export function shareWebpage(data) {
return new Promise((resolve, reject) => {
nativeShareWebpage(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share miniProgram
* @method shareMiniProgram
* @param {Object} data
*/
export function shareMiniProgram(data) {
return new Promise((resolve, reject) => {
nativeShareMiniProgram(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share something to timeline/moments/朋友圈
* @method shareToTimeline
* @param {Object} data
* @param {String} data.thumbImage - Thumb image of the message, which can be a uri or a resource id.
* @param {String} data.type - Type of this message. Could be {news|text|imageUrl|imageFile|imageResource|video|audio|file}
* @param {String} data.webpageUrl - Required if type equals news. The webpage link to share.
* @param {String} data.imageUrl - Provide a remote image if type equals image.
* @param {String} data.videoUrl - Provide a remote video if type equals video.
* @param {String} data.musicUrl - Provide a remote music if type equals audio.
* @param {String} data.filePath - Provide a local file if type equals file.
* @param {String} data.fileExtension - Provide the file type if type equals file.
*/
export function shareToTimeline(data) {
return new Promise((resolve, reject) => {
nativeShareToTimeline(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* 打开小程序
* @method launchMini
* @param
* @param {String} userName - 拉起的小程序的username
* @param {Integer} miniProgramType - 拉起小程序的类型. 0-正式版 1-开发版 2-体验版
* @param {String} path - 拉起小程序页面的可带参路径不填默认拉起小程序首页
*/
export function launchMiniProgram({userName, miniProgramType = 0, path = ''}) {
return new Promise((resolve, reject) => {
if (miniProgramType !== 0 && miniProgramType !== 1 && miniProgramType !== 2) {
reject(new WechatError({errStr: '拉起小程序的类型不对0-正式版 1-开发版 2-体验版', errCode: -1}))
return
}
nativeLaunchMiniProgram({userName, miniProgramType, path});
emitter.once('WXLaunchMiniProgramReq.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share something to a friend or group
* @method shareToSession
* @param {Object} data
* @param {String} data.thumbImage - Thumb image of the message, which can be a uri or a resource id.
* @param {String} data.type - Type of this message. Could be {news|text|imageUrl|imageFile|imageResource|video|audio|file}
* @param {String} data.webpageUrl - Required if type equals news. The webpage link to share.
* @param {String} data.imageUrl - Provide a remote image if type equals image.
* @param {String} data.videoUrl - Provide a remote video if type equals video.
* @param {String} data.musicUrl - Provide a remote music if type equals audio.
* @param {String} data.filePath - Provide a local file if type equals file.
* @param {String} data.fileExtension - Provide the file type if type equals file.
*/
export function shareToSession(data) {
return new Promise((resolve, reject) => {
nativeShareToSession(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* Share something to favorite
* @method shareToFavorite
* @param {Object} data
* @param {String} data.thumbImage - Thumb image of the message, which can be a uri or a resource id.
* @param {String} data.type - Type of this message. Could be {news|text|imageUrl|imageFile|imageResource|video|audio|file}
* @param {String} data.webpageUrl - Required if type equals news. The webpage link to share.
* @param {String} data.imageUrl - Provide a remote image if type equals image.
* @param {String} data.videoUrl - Provide a remote video if type equals video.
* @param {String} data.musicUrl - Provide a remote music if type equals audio.
* @param {String} data.filePath - Provide a local file if type equals file.
* @param {String} data.fileExtension - Provide the file type if type equals file.
*/
export function shareToFavorite(data) {
return new Promise((resolve, reject) => {
nativeShareToFavorite(data);
emitter.once('SendMessageToWX.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* wechat pay
* @param {Object} data
* @param {String} data.partnerId
* @param {String} data.prepayId
* @param {String} data.nonceStr
* @param {String} data.timeStamp
* @param {String} data.package
* @param {String} data.sign
* @returns {Promise}
*/
export function pay(data) {
function correct(actual, fixed) {
if (!data[fixed] && data[actual]) {
data[fixed] = data[actual];
delete data[actual];
}
}
correct('prepayid', 'prepayId');
correct('noncestr', 'nonceStr');
correct('partnerid', 'partnerId');
correct('timestamp', 'timeStamp');
// FIXME(94cstyles)
// Android requires the type of the timeStamp field to be a string
if (Platform.OS === 'android') data.timeStamp = String(data.timeStamp)
return new Promise((resolve, reject) => {
WeChat.pay(data, result => {
if (result) reject(result);
});
emitter.once('PayReq.Resp', resp => {
if (resp.errCode === 0) {
resolve(resp);
} else {
reject(new WechatError(resp));
}
});
});
}
/**
* promises will reject with this error when API call finish with an errCode other than zero.
*/
export class WechatError extends Error {
constructor(resp) {
const message = resp.errStr || resp.errCode.toString();
super(message);
this.name = 'WechatError';
this.code = resp.errCode;
// avoid babel's limition about extending Error class
// https://github.com/babel/babel/issues/3083
if (typeof Object.setPrototypeOf === 'function') {
Object.setPrototypeOf(this, WechatError.prototype);
} else {
this.__proto__ = WechatError.prototype;
}
}
}

31
ios/RCTWeChat.h Normal file
View File

@ -0,0 +1,31 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <React/RCTBridgeModule.h>
#import "WXApi.h"
// define share type constants
#define RCTWXShareTypeNews @"news"
#define RCTWXShareTypeThumbImageUrl @"thumbImage"
#define RCTWXShareTypeImageUrl @"imageUrl"
#define RCTWXShareTypeImageFile @"imageFile"
#define RCTWXShareTypeImageResource @"imageResource"
#define RCTWXShareTypeText @"text"
#define RCTWXShareTypeVideo @"video"
#define RCTWXShareTypeAudio @"audio"
#define RCTWXShareTypeFile @"file"
#define RCTWXShareType @"type"
#define RCTWXShareTitle @"title"
#define RCTWXShareDescription @"description"
#define RCTWXShareWebpageUrl @"webpageUrl"
#define RCTWXShareImageUrl @"imageUrl"
#define RCTWXEventName @"WeChat_Resp"
#define RCTWXEventNameWeChatReq @"WeChat_Req"
@interface RCTWeChat : NSObject <RCTBridgeModule, WXApiDelegate>
@property NSString* appId;
@end

524
ios/RCTWeChat.m Normal file
View File

@ -0,0 +1,524 @@
// Created by little-snow-fox on 2019-10-9.
#import "RCTWeChat.h"
#import "WXApiObject.h"
#import <React/RCTEventDispatcher.h>
#import <React/RCTBridge.h>
#import <React/RCTLog.h>
#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
{
self = [super init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:@"RCTOpenURLNotification" object:nil];
}
return self;
}
- (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])
{
return YES;
} else {
return NO;
}
}
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
+ (BOOL)requiresMainQueueSetup {
return YES;
}
//
- (UIImage *) getImageFromURL:(NSString *)fileURL {
UIImage * result;
NSData * data = [NSData dataWithContentsOfURL:[NSURL URLWithString:fileURL]];
result = [UIImage imageWithData:data];
return result;
}
//
- (NSData *)compressImage:(UIImage *)image toByte:(NSUInteger)maxLength {
// Compress by quality
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) {
compression = (max + min) / 2;
data = UIImageJPEGRepresentation(image, compression);
if (data.length < maxLength * 0.9) {
min = compression;
} else if (data.length > maxLength) {
max = compression;
} else {
break;
}
}
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
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
:(NSString *)universalLink
:(RCTResponseSenderBlock)callback)
{
self.appId = appid;
callback(@[[WXApi registerApp:appid universalLink:universalLink] ? [NSNull null] : INVOKE_FAILED]);
}
// RCT_EXPORT_METHOD(registerAppWithDescription:(NSString *)appid
// :(NSString *)appdesc
// :(RCTResponseSenderBlock)callback)
// {
// callback(@[[WXApi registerApp:appid withDescription:appdesc] ? [NSNull null] : INVOKE_FAILED]);
// }
RCT_EXPORT_METHOD(isWXAppInstalled:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], @([WXApi isWXAppInstalled])]);
}
RCT_EXPORT_METHOD(isWXAppSupportApi:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], @([WXApi isWXAppSupportApi])]);
}
RCT_EXPORT_METHOD(getWXAppInstallUrl:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], [WXApi getWXAppInstallUrl]]);
}
RCT_EXPORT_METHOD(getApiVersion:(RCTResponseSenderBlock)callback)
{
callback(@[[NSNull null], [WXApi getApiVersion]]);
}
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];
req.openID = openid;
// callback(@[[WXApi sendReq:req] ? [NSNull null] : INVOKE_FAILED]);
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
RCT_EXPORT_METHOD(sendAuthRequest:(NSString *)scope
:(NSString *)state
:(RCTResponseSenderBlock)callback)
{
SendAuthReq* req = [[SendAuthReq alloc] init];
req.scope = scope;
req.state = state;
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
RCT_EXPORT_METHOD(sendSuccessResponse:(RCTResponseSenderBlock)callback)
{
BaseResp* resp = [[BaseResp alloc] init];
resp.errCode = WXSuccess;
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendResp:resp completion:completion];
// callback(@[[WXApi sendResp:resp] ? [NSNull null] : INVOKE_FAILED]);
}
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 )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendResp:resp completion:completion];
// callback(@[[WXApi sendResp:resp] ? [NSNull null] : INVOKE_FAILED]);
}
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 )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendResp:resp completion:completion];
// callback(@[[WXApi sendResp:resp] ? [NSNull null] : INVOKE_FAILED]);
}
//
RCT_EXPORT_METHOD(shareText:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = YES;
req.text = data[@"text"];
req.scene = data[@"scene"] || WXSceneSession;
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
//
RCT_EXPORT_METHOD(shareImage:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
NSString *imageUrl = data[@"imageUrl"];
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)
{
callback([NSArray arrayWithObject:@"shareImage: ImageUrl value, Could not find file suffix."]);
return;
}
//
UIImage *image = [self getImageFromURL:imageUrl];
// UIImage
NSData *imageData = UIImageJPEGRepresentation(image, 1);
// WXImageObject
WXImageObject *imageObject = [WXImageObject object];
imageObject.imageData = imageData;
WXMediaMessage *message = [WXMediaMessage message];
// 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"] || WXSceneSession;
// [WXApi sendReq:req];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
//
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"];
NSString *thumbImageUrl = data[@"thumbImageUrl"];
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
//
UIImage *image = [self getImageFromURL:thumbImageUrl];
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"] || WXSceneSession;
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
//
RCT_EXPORT_METHOD(shareVideo:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXVideoObject *videoObject = [WXVideoObject object];
videoObject.videoUrl = data[@"videoUrl"];
videoObject.videoLowBandUrl = data[@"videoLowBandUrl"];
WXMediaMessage *message = [WXMediaMessage message];
message.title = data[@"title"];
message.description = data[@"description"];
NSString *thumbImageUrl = data[@"thumbImageUrl"];
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:thumbImageUrl];
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"] || WXSceneSession;
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)
{
WXWebpageObject *webpageObject = [WXWebpageObject object];
webpageObject.webpageUrl = data[@"webpageUrl"];
WXMediaMessage *message = [WXMediaMessage message];
message.title = data[@"title"];
message.description = data[@"description"];
NSString *thumbImageUrl = data[@"thumbImageUrl"];
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:thumbImageUrl];
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"] || WXSceneSession;
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
}
//
RCT_EXPORT_METHOD(shareMiniProgram:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
WXMiniProgramObject *object = [WXMiniProgramObject object];
object.webpageUrl = data[@"webpageUrl"];
object.userName = data[@"userName"];
object.path = data[@"path"];
NSString *hdImageUrl = data[@"hdImageUrl"];
if (hdImageUrl != NULL && ![hdImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:hdImageUrl];
// 128KB
object.hdImageData = [self compressImage: image toByte:131072];
}
object.withShareTicket = data[@"withShareTicket"];
object.miniProgramType = data[@"miniProgramType"] || WXMiniProgramTypeRelease;
WXMediaMessage *message = [WXMediaMessage message];
message.title = data[@"title"];
message.description = data[@"description"];
//32KB
//使WXMiniProgramObjecthdImageData
NSString *thumbImageUrl = data[@"thumbImageUrl"];
if (thumbImageUrl != NULL && ![thumbImageUrl isEqual:@""]) {
UIImage *image = [self getImageFromURL:thumbImageUrl];
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"] || WXSceneSession;
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)
{
WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object];
// username
launchMiniProgramReq.userName = data[@"userName"];
//
launchMiniProgramReq.path = data[@"path"];
//
launchMiniProgramReq.miniProgramType = [data[@"miniProgramType"] integerValue];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:launchMiniProgramReq completion:completion];
// BOOL success = [WXApi sendReq:launchMiniProgramReq];
// 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 )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
// BOOL success = [WXApi sendReq:req];
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
}
#pragma mark - wx callback
-(void) onReq:(BaseReq*)req
{
if ([req isKindOfClass:[LaunchFromWXReq class]]) {
LaunchFromWXReq *launchReq = req;
NSString *appParameter = launchReq.message.messageExt;
NSMutableDictionary *body = @{@"errCode":@0}.mutableCopy;
body[@"type"] = @"LaunchFromWX.Req";
body[@"lang"] = launchReq.lang;
body[@"country"] = launchReq.country;
body[@"appParameter"] = appParameter;
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventNameWeChatReq body:body];
}
}
-(void) onResp:(BaseResp*)resp
{
if([resp isKindOfClass:[SendMessageToWXResp class]])
{
SendMessageToWXResp *r = (SendMessageToWXResp *)resp;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
body[@"lang"] = r.lang;
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;
body[@"errStr"] = r.errStr;
body[@"state"] = r.state;
body[@"lang"] = r.lang;
body[@"country"] =r.country;
body[@"type"] = @"SendAuth.Resp";
if (resp.errCode == WXSuccess) {
if (self.appId && r) {
// iosappidOK
[body addEntriesFromDictionary:@{@"appid":self.appId, @"code":r.code}];
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
}
}
else {
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
}
} else if ([resp isKindOfClass:[PayResp class]]) {
PayResp *r = (PayResp *)resp;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
body[@"type"] = @(r.type);
body[@"returnKey"] =r.returnKey;
body[@"type"] = @"PayReq.Resp";
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
} else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]){
WXLaunchMiniProgramResp *r = (WXLaunchMiniProgramResp *)resp;
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];
}
}
@end

38
ios/RCTWeChat.podspec Normal file
View File

@ -0,0 +1,38 @@
#
# Be sure to run `pod spec lint RCTPili.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/
#
Pod::Spec.new do |s|
s.name = "RCTWeChat"
s.version = "0.1.0"
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}"
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}
DESC
s.homepage = "https://github.com/weflex/react-native-wechat"
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "weflex" => "336021910@qq.com" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/weflex/react-native-wechat.git", :tag => "master" }
s.source_files = "**/*.{h,m}"
s.requires_arc = true
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
s.dependency "React"
s.vendored_libraries = "libWeChatSDK.a"
s.ios.frameworks = 'SystemConfiguration','CoreTelephony','XCTest'
s.ios.library = 'sqlite3','c++','z'
end

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

@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,89 @@
<?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 = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
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 = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86D238411BD0BB9E00C75D01"
BuildableName = "libRCTWeChat.a"
BlueprintName = "RCTWeChat"
ReferencedContainer = "container:RCTWeChat.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

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

110
ios/README.txt Normal file
View File

@ -0,0 +1,110 @@
SDK1.8.6.1
1.短信授权登录使用的UIWebview切换成WKWebview
SDK1.8.6
1. 支持Universal Link拉起微信以及返回App
2. SDK移除MTA库
SDK1.8.5
1. 更换MTA库:取消对剪切板的访问, 防止和其他SDK竞争导致crash
2. NSMutableArray的MTA分类方法改名减少命名冲突
3. 不含支付功能版本移除非税支付和医保支付接口
4. 分享音乐支持填写歌词和高清封面图
SDK1.8.4
1. 调整分享图片大小限制
2. 新增openBusinessView接口
SDK1.8.3
1. SDK增加调起微信刷卡支付接口
2. SDK增加小程序订阅消息接口
3. 修复小程序订阅消息接口没有resp的问题
SDK1.8.2
1. SDK增加开发票授权 WXInvoiceAuthInsert
2. SDK增加非税接口 WXNontaxPay
3. SDK增加医保接口 WXPayInsurance
4. 更换MTA库
SDK1.8.1
1. SDK打开小程序支持指定版本体验开发正式版
2. SDK分享小程序支持指定版本体验开发正式版
3. SDK支持输出log日志
SDK1.8.0
1. SDK支持打开小程序
2. SDK分享小程序支持shareTicket
SDK1.7.9
1. SDK订阅一次性消息
SDK1.7.8
1 SDK分享小程序支持大图
SDK1.7.7
1 增加SDK分享小程序
2 增加选择发票接口
SDK1.7.6
1. 提高稳定性
1 修复mta崩溃
2 新增接口支持开发者关闭mta数据统计上报
SDK1.7.5
1. 提高稳定性
2. 加快registerApp接口启动速度
SDK1.7.4
1. 更新支持iOS启用 ATS(App Transport Security)
2. 需要在工程中链接CFNetwork.framework
3. 在工程配置中的”Other Linker Flags”中加入”-Objc -all_load”
SDK1.7.3
1. 增强稳定性适配iOS10
2. 修复小于32K的jpg格式缩略图设置失败的问题
SDK1.7.2
1. 修复因CTTeleponyNetworkInfo引起的崩溃问题
SDK1.7.1
1. 支持兼容ipv6(提升稳定性)
2. xCode Version 7.3.1 (7D1014) 编译
SDK1.7
1. 支持兼容ipv6
2. 修复若干问题增强稳定性
SDK1.6.3
1. xCode7.2 构建的sdk包。
2. 请使用xCode7.2进行编译。
3. 需要在Build Phases中Link Security.framework
4. 修复若干小问题。
SDK1.6.2
1、xCode7.1 构建的sdk包
2、请使用xCode7.1进行编译
SDK1.6.1
1、修复armv7s下,bitcode可能编译不过
2、解决warning
SDK1.6
1、iOS 9系统策略更新限制了http协议的访问此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单才可正常检查其他应用是否安装。
受此影响当你的应用在iOS 9中需要使用微信SDK的相关能力分享、收藏、支付、登录等需要在“Info.plist”里增加如下代码
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
2、开发者需要在工程中链接上 CoreTelephony.framework
3、解决bitcode编译不过问题
SDK1.5
1、废弃safeSendReq:接口使用sendReq:即可。
2、新增+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id<WXApiDelegate>) delegate;
支持未安装微信情况下Auth,具体见WXApi.h接口描述
3、微信开放平台新增了微信模块用户统计功能便于开发者统计微信功能模块的用户使用和活跃情况。开发者需要在工程中链接上:SystemConfiguration.framework,libz.dylib,libsqlite3.0.dylib。

183
ios/WXApi.h Normal file
View File

@ -0,0 +1,183 @@
//
// WXApi.h
// 所有Api接口
//
// Created by Wechat on 12-2-28.
// Copyright (c) 2012年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "WXApiObject.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark - WXApiDelegate
/*! @brief 接收并处理来自微信终端程序的事件消息
*
*
* WXApiDelegate handleOpenURL:delegate:使
*/
@protocol WXApiDelegate <NSObject>
@optional
/*! @brief 收到一个来自微信的请求第三方应用程序处理完后调用sendResp向微信发送结果
*
* sendResp发送处理结果给微信
* GetMessageFromWXReqShowMessageFromWXReq等
* @param req
*/
- (void) onReq:(BaseReq*)req;
/*! @brief 发送一个sendReq后收到微信的回应
*
* sendReq后会收到onResp
* SendMessageToWXRespSendAuthResp等
* @param resp具体的回应内容
*/
- (void) onResp:(BaseResp*)resp;
@end
#pragma mark - WXApiLogDelegate
@protocol WXApiLogDelegate <NSObject>
- (void)onLog:(NSString*)log logLevel:(WXLogLevel)level;
@end
#pragma mark - WXApi
/*! @brief 微信Api接口函数类
*
* SDK的所有接口
*/
@interface WXApi : NSObject
/*! @brief WXApi的成员函数向微信终端程序注册第三方应用。
*
*
* @attention 线
* @param appid ID
* @param universalLink Universal Link
* @return YESNO
*/
+ (BOOL)registerApp:(NSString *)appid universalLink:(NSString *)universalLink;
/*! @brief 处理旧版微信通过URL启动App时传递的数据
*
* application:openURL:sourceApplication:annotation:application:handleOpenURL中调用
* @param url URL
* @param delegate WXApiDelegate对象
* @return YESNO
*/
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(nullable id<WXApiDelegate>)delegate;
/*! @brief 处理微信通过Universal Link启动App时传递的数据
*
* application:continueUserActivity:restorationHandler:
* @param userActivity API传递过来的userActivity
* @param delegate WXApiDelegate对象
* @return YESNO
*/
+ (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(nullable id<WXApiDelegate>)delegate;
/*! @brief 检查微信是否已被用户安装
*
* @return YESNO
*/
+ (BOOL)isWXAppInstalled;
/*! @brief 判断当前微信的版本是否支持OpenApi
*
* @return YESNO
*/
+ (BOOL)isWXAppSupportApi;
/*! @brief 获取微信的itunes安装地址
*
* @return
*/
+ (NSString *)getWXAppInstallUrl;
/*! @brief 获取当前微信SDK的版本号
*
* @return SDK的版本号
*/
+ (NSString *)getApiVersion;
/*! @brief 打开微信
*
* @return YESNO
*/
+ (BOOL)openWXApp;
/*! @brief 发送请求到微信等待微信返回onResp
*
* onResponResp
* SendAuthReqSendMessageToWXReqPayReq等
* @param req
* @param completion block
*/
+ (void)sendReq:(BaseReq *)req completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 收到微信onReq的请求发送对应的应答给微信并切换到微信界面
*
* onReq的请求
* GetMessageFromWXRespShowMessageFromWXResp等
* @param resp
* @param completion block
*/
+ (void)sendResp:(BaseResp*)resp completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 发送Auth请求到微信支持用户没安装微信等待微信返回onResp
*
* onResponRespSendAuthReq类型
* @param req
* @param viewController
* @param delegate WXApiDelegate对象
* @param completion block
*/
+ (void)sendAuthReq:(SendAuthReq *)req viewController:(UIViewController*)viewController delegate:(nullable id<WXApiDelegate>)delegate completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief WXApi的成员函数接受微信的log信息。byBlock
1:SDK会强引用这个block,,
2:startLog by block之后startLoad,logBlocklogBlock
*
* @param level log的级别
* @param logBlock log的回调block
*/
+ (void)startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock;
/*! @brief WXApi的成员函数接受微信的log信息。byDelegate
1:sdk会弱引用这个delegateWXApiDelegate同一个对象
2:startLog by delegate之后startLoad,logDelegate对象
* @param level log的级别
* @param logDelegate log的回调代理
*/
+ (void)startLogByLevel:(WXLogLevel)level logDelegate:(id<WXApiLogDelegate>)logDelegate;
/*! @brief 停止打印log会清理block或者delegate为空释放block
* @param
*/
+ (void)stopLog;
@end
NS_ASSUME_NONNULL_END

1026
ios/WXApiObject.h Normal file

File diff suppressed because it is too large Load Diff

68
ios/WechatAuthSDK.h Normal file
View File

@ -0,0 +1,68 @@
//
// WechatAuthSDK.h
// WechatAuthSDK
//
// Created by 李凯 on 13-11-29.
// Copyright (c) 2013年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
enum AuthErrCode {
WechatAuth_Err_Ok = 0, //Auth成功
WechatAuth_Err_NormalErr = -1, //普通错误
WechatAuth_Err_NetworkErr = -2, //网络错误
WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败
WechatAuth_Err_Cancel = -4, //用户取消授权
WechatAuth_Err_Timeout = -5, //超时
};
@protocol WechatAuthAPIDelegate<NSObject>
@optional
- (void)onAuthGotQrcode:(UIImage *)image; //得到二维码
- (void)onQrcodeScanned; //二维码被扫描
- (void)onAuthFinish:(int)errCode AuthCode:(nullable NSString *)authCode; //成功登录
@end
@interface WechatAuthSDK : NSObject{
NSString *_sdkVersion;
__weak id<WechatAuthAPIDelegate> _delegate;
}
@property(nonatomic, weak, nullable) id<WechatAuthAPIDelegate> delegate;
@property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号
/*! @brief 发送登录请求等待WechatAuthAPIDelegate回调
*
* @param appId ID
* @param nonceStr 使signature不同
* @param timeStamp
* @param scope ,
* @param signature
* @param schemeData scheme后
* @return YESNO
:Auth在运行Auth未完成或未Stop再次调用Auth接口时会返回NO
*/
- (BOOL)Auth:(NSString *)appId
nonceStr:(NSString *)nonceStr
timeStamp:(NSString *)timeStamp
scope:(NSString *)scope
signature:(NSString *)signature
schemeData:(nullable NSString *)schemeData;
/*! @brief 暂停登录请求
*
* @return YESNO
*/
- (BOOL)StopAuth;
@end
NS_ASSUME_NONNULL_END

BIN
ios/libWeChatSDK.a Normal file

Binary file not shown.

2827
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

38
package.json Normal file
View File

@ -0,0 +1,38 @@
{
"name": "react-native-wechat-lib",
"version": "1.1.0",
"description": "react-native library for wechat app",
"main": "index.js",
"scripts": {
"test": "echo 1"
},
"repository": {
"type": "git",
"url": "https://github.com/little-snow-fox/react-native-wechat-lib.git"
},
"keywords": [
"wechat",
"react-native",
"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"
}
],
"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"
}

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',
};

99
playground/.flowconfig Normal file
View File

@ -0,0 +1,99 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
node_modules/react-native/Libraries/react-native/React.js
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*
; Flow doesn't support platforms
.*/Libraries/Utilities/HMRLoadingView.js
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
[options]
emoji=true
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js
module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
munge_underscores=true
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error
[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import
[version]
^0.98.0

1
playground/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.pbxproj -text

59
playground/.gitignore vendored Normal file
View File

@ -0,0 +1,59 @@
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
# Bundle artifact
*.jsbundle
# CocoaPods
/ios/Pods/

View File

@ -0,0 +1 @@
{}

144
playground/App.js Normal file
View File

@ -0,0 +1,144 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, { Fragment, Component } from 'react';
import {
TouchableOpacity,
SafeAreaView,
ScrollView,
StyleSheet,
StatusBar,
Platform,
View,
Text,
Alert
} from 'react-native';
import {
Header,
Colors
} from 'react-native/Libraries/NewAppScreen';
import * as WeChat from 'react-native-wechat';
export default class App extends Component {
shareOptions = {
title: 'playground',
description: '微信分享测试',
thumbImage: 'https://i.loli.net/2019/09/03/62FauzAY37gsEXV.png',
type: 'news',
webpageUrl: 'https://github.com/little-snow-fox/react-native-wechat-lib'
}
constructor(props) {
super(props);
this.state = {
apiVersion: null,
isWXAppInstalled: false,
wxAppInstallUrl: null,
isWXAppSupportApi: false
}
}
handleOpenApp () {
if (this.state.isWXAppInstalled) {
return WeChat.openWXApp();
} else {
Alert.alert('没有安装微信,请安装之后重试');
}
}
handleShareToSession () {
if (this.state.isWXAppInstalled) {
WeChat.shareToSession(this.shareOptions).catch((error) => {
Alert.alert(error.message);
});
} else {
Alert.alert('没有安装微信,请安装之后重试');
}
}
handleShareToMoment () {
if (this.state.isWXAppInstalled) {
WeChat.shareToTimeline(this.shareOptions).catch((error) => {
Alert.alert(error.message);
});
} else {
Alert.alert('没有安装微信,请安装之后重试');
}
}
async componentDidMount() {
try {
WeChat.registerApp('your wexin AppID'); // Replace with your AppID
this.setState({
apiVersion: await WeChat.getApiVersion(),
wxAppInstallUrl: Platform.OS === 'ios' ? await WeChat.getWXAppInstallUrl(): null,
isWXAppSupportApi: await WeChat.isWXAppSupportApi(),
isWXAppInstalled: await WeChat.isWXAppInstalled()
});
} catch (e) {
console.error(e);
}
}
render() {
const { apiVersion } = this.state;
return (
<Fragment>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<Header />
<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.highlight}>
ApiVersion: <Text>{ apiVersion }</Text>
</Text>
<TouchableOpacity style={styles.button} onPress={() => this.handleOpenApp()}>
<Text>打开微信</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => this.handleShareToSession()}>
<Text>分享至微信好友</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => this.handleShareToMoment()}>
<Text>分享至朋友圈</Text>
</TouchableOpacity>
</View>
</View>
</ScrollView>
</SafeAreaView>
</Fragment>
);
}
};
const styles = StyleSheet.create({
scrollView: {
backgroundColor: Colors.lighter
},
body: {
backgroundColor: Colors.white
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24
},
highlight: {
fontSize: 24,
fontWeight: '600',
color: Colors.black,
textAlign: 'center'
},
button: {
flex: 1,
margin: 10,
borderWidth: 1,
borderRadius: 30,
paddingVertical: 12,
alignItems: 'center',
justifyContent: 'center',
borderColor: Colors.black
}
});

48
playground/README.md Normal file
View File

@ -0,0 +1,48 @@
# Playground for react-native-wechat
Make sure you have the development environment set up with this [Tutorial](https://facebook.github.io/react-native/docs/getting-started) at first.
首先确保已经按[教程](https://facebook.github.io/react-native/docs/getting-started)配置好 React Native 本地开发环境。
## How to run
```sh
$ git clone this repo
$ cd playground
$ yarn install or npm install
```
Ensure emulator is ready or mobile device is connected to your machine:
运行前先开启模拟器或连接真机调试。
```sh
$ npm run start or react-native start --reset-cache
```
iOS:
```sh
$ cd ios && pod install
```
Add the following libraries to your "Link Binary with Libraries" in Targets > Build Phases in Xcode :
点击 Xcode 左侧 Targets > Build Phases 中的 Link Binary with Libraries 选项添加以下库:
- [x] `SystemConfiguration.framework`
- [x] `CoreTelephony.framework`
- [x] `libsqlite3.0`
- [x] `libc++`
- [x] `libz`
```sh
$ react-native run-ios
```
Android:
```sh
$ react-native run-android
```

View File

@ -0,0 +1,14 @@
/**
* @format
*/
import 'react-native';
import React from 'react';
import App from '../App';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
renderer.create(<App />);
});

View File

@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
lib_deps = []
create_aar_targets(glob(["libs/*.aar"]))
create_jar_targets(glob(["libs/*.jar"]))
android_library(
name = "all-libs",
exported_deps = lib_deps,
)
android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)
android_build_config(
name = "build_config",
package = "com.playground",
)
android_resource(
name = "res",
package = "com.playground",
res = "src/main/res",
)
android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)

View File

@ -0,0 +1,186 @@
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* 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
* entryFile: "index.android.js",
*
* // https://facebook.github.io/react-native/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 = [
entryFile: "index.js"
]
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
/**
* Use international variant JavaScriptCore
* 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 useIntlJsc = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.playground"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
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://facebook.github.io/react-native/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
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 =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':RCTWeChat')
// JSC from node_modules
if (useIntlJsc) {
implementation 'org.webkit:android-jsc-intl:+'
} else {
implementation 'org.webkit:android-jsc:+'
}
}
// 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.compile
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

View File

@ -0,0 +1,19 @@
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)

View File

@ -0,0 +1,14 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
-keep class com.tencent.mm.sdk.** {
*;
}

View File

@ -0,0 +1,8 @@
<?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" />
</manifest>

View File

@ -0,0 +1,36 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.playground">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity
android:name=".wxapi.WXEntryActivity"
android:label="@string/app_name"
android:exported="true"
/>
<activity
android:name=".wxapi.WXPayEntryActivity"
android:label="@string/app_name"
android:exported="true"
/>
</application>
</manifest>

View File

@ -0,0 +1,15 @@
package com.playground;
import com.facebook.react.ReactActivity;
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 "playground";
}
}

View File

@ -0,0 +1,48 @@
package com.playground;
import android.app.Application;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import com.theweflex.react.WeChatPackage;
import java.util.List;
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();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new WeChatPackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}

View File

@ -0,0 +1,14 @@
package com.playground.wxapi;
import android.app.Activity;
import android.os.Bundle;
import com.theweflex.react.WeChatModule;
public class WXEntryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WeChatModule.handleIntent(getIntent());
finish();
}
}

View File

@ -0,0 +1,14 @@
package com.playground.wxapi;
import android.app.Activity;
import android.os.Bundle;
import com.theweflex.react.WeChatModule;
public class WXPayEntryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WeChatModule.handleIntent(getIntent());
finish();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

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

View File

@ -0,0 +1,9 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textColor">#000000</item>
</style>
</resources>

View File

@ -0,0 +1,38 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
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")
}
google()
jcenter()
}
}

View File

@ -0,0 +1,21 @@
# 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: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# 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
android.useAndroidX=true
android.enableJetifier=true

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

188
playground/android/gradlew vendored Executable file
View File

@ -0,0 +1,188 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or 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
#
# 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.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
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
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
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"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# 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
;;
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" = "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
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
# 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
# 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"`
# 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
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" "$@"

100
playground/android/gradlew.bat vendored Normal file
View File

@ -0,0 +1,100 @@
@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 http://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 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 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

View File

@ -0,0 +1,5 @@
rootProject.name = 'playground'
include ':RCTWeChat'
project(':RCTWeChat').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wechat/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

4
playground/app.json Normal file
View File

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

View File

@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};

9
playground/index.js Normal file
View File

@ -0,0 +1,9 @@
/**
* @format
*/
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);

47
playground/ios/Podfile Normal file
View File

@ -0,0 +1,47 @@
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'playground' do
# Pods for playground
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'playgroundTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'playground-tvOS' do
# Pods for playground-tvOS
target 'playground-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end

193
playground/ios/Podfile.lock Normal file
View File

@ -0,0 +1,193 @@
PODS:
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.6)
- Folly (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
- Folly/Default (= 2018.10.22.00)
- glog
- Folly/Default (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
- glog
- glog (0.3.5)
- RCTWeChat (1.9.12):
- React
- React (0.60.0):
- React-Core (= 0.60.0)
- React-DevSupport (= 0.60.0)
- React-RCTActionSheet (= 0.60.0)
- React-RCTAnimation (= 0.60.0)
- React-RCTBlob (= 0.60.0)
- React-RCTImage (= 0.60.0)
- React-RCTLinking (= 0.60.0)
- React-RCTNetwork (= 0.60.0)
- React-RCTSettings (= 0.60.0)
- React-RCTText (= 0.60.0)
- React-RCTVibration (= 0.60.0)
- React-RCTWebSocket (= 0.60.0)
- React-Core (0.60.0):
- Folly (= 2018.10.22.00)
- React-cxxreact (= 0.60.0)
- React-jsiexecutor (= 0.60.0)
- yoga (= 0.60.0.React)
- React-cxxreact (0.60.0):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsinspector (= 0.60.0)
- React-DevSupport (0.60.0):
- React-Core (= 0.60.0)
- React-RCTWebSocket (= 0.60.0)
- React-fishhook (0.60.0)
- React-jsi (0.60.0):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsi/Default (= 0.60.0)
- React-jsi/Default (0.60.0):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsiexecutor (0.60.0):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-cxxreact (= 0.60.0)
- React-jsi (= 0.60.0)
- React-jsinspector (0.60.0)
- React-RCTActionSheet (0.60.0):
- React-Core (= 0.60.0)
- React-RCTAnimation (0.60.0):
- React-Core (= 0.60.0)
- React-RCTBlob (0.60.0):
- React-Core (= 0.60.0)
- React-RCTNetwork (= 0.60.0)
- React-RCTWebSocket (= 0.60.0)
- React-RCTImage (0.60.0):
- React-Core (= 0.60.0)
- React-RCTNetwork (= 0.60.0)
- React-RCTLinking (0.60.0):
- React-Core (= 0.60.0)
- React-RCTNetwork (0.60.0):
- React-Core (= 0.60.0)
- React-RCTSettings (0.60.0):
- React-Core (= 0.60.0)
- React-RCTText (0.60.0):
- React-Core (= 0.60.0)
- React-RCTVibration (0.60.0):
- React-Core (= 0.60.0)
- React-RCTWebSocket (0.60.0):
- React-Core (= 0.60.0)
- React-fishhook (= 0.60.0)
- yoga (0.60.0.React)
DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCTWeChat (from `../node_modules/react-native-wechat`)
- React (from `../node_modules/react-native/`)
- React-Core (from `../node_modules/react-native/React`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
- React-DevSupport (from `../node_modules/react-native/React`)
- React-fishhook (from `../node_modules/react-native/Libraries/fishhook`)
- 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-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- 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-RCTWebSocket (from `../node_modules/react-native/Libraries/WebSocket`)
- yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- boost-for-react-native
EXTERNAL SOURCES:
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
RCTWeChat:
:path: "../node_modules/react-native-wechat"
React:
:path: "../node_modules/react-native/"
React-Core:
:path: "../node_modules/react-native/React"
React-cxxreact:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
React-DevSupport:
:path: "../node_modules/react-native/React"
React-fishhook:
:path: "../node_modules/react-native/Libraries/fishhook"
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-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation:
:path: "../node_modules/react-native/Libraries/NativeAnimation"
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-RCTWebSocket:
:path: "../node_modules/react-native/Libraries/WebSocket"
yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
RCTWeChat: edb02d76aaf9b2e698e515e3c57bf143a290d9d7
React: 4b3c068e793e96672dcd186a2b572fac43e4b031
React-Core: 3dc86b22920597f813c62a96db3165950b64826b
React-cxxreact: 0dacb291e59b81e7c3f22a2118bee853ba8a60d2
React-DevSupport: 4eb4135386acd10c2586cc9c759bf96b4dac035e
React-fishhook: 86ca737527bb9d860efbb943c11c729a5b69aa3d
React-jsi: 8e128c4d0d8febc2977ef617d1c09bb54326069c
React-jsiexecutor: 7a3554f703a58963ec80b860144ea0f0e9b910e1
React-jsinspector: d4ed52225912efe0019bb7f1a225aec20f23049a
React-RCTActionSheet: b27ff3cf3a68f917c46d2b94abf938b625b96570
React-RCTAnimation: 9e4708e5bd65fca8285ce7c0aa076f3f4fa5c2f8
React-RCTBlob: 6eafcc3a24f33785692a7be24918ade607bc8719
React-RCTImage: 46b965d7225b428ea11580ead08a4318aef1d6be
React-RCTLinking: d65b9f56cf0b8e171575a86764df7bb019ac28d6
React-RCTNetwork: 783ee2f430740e58f724e46adc79fe7feff64202
React-RCTSettings: aa28315aadfbfaf94206d865673ae509f1e97c07
React-RCTText: 685fca2e13b024271048e7e247ef24476f28a41e
React-RCTVibration: 4ee1cf208ab17a50fafb1c16ffe28fe594a64e4f
React-RCTWebSocket: fca087d583724aa0e5fef7d911f0f2a28d0f2736
yoga: 616fde658be980aa60a2158835170f3f9c2d04b4
PODFILE CHECKSUM: 7a7e8cd3eb67dfaa229dd770d0629c67ab0b2f2b
COCOAPODS: 1.7.5

View File

@ -0,0 +1,53 @@
<?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>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1,24 @@
<?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>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</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>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,951 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* playgroundTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* playgroundTests.m */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
17EBA2EE233B84AB00935B37 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17EBA2ED233B84AB00935B37 /* SystemConfiguration.framework */; };
17EBA2F0233B84CE00935B37 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17EBA2EF233B84CE00935B37 /* CoreTelephony.framework */; };
17EBA2F2233B84DC00935B37 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 17EBA2F1233B84DC00935B37 /* libsqlite3.0.tbd */; };
17EBA2F4233B84EA00935B37 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 17EBA2F3233B84EA00935B37 /* libc++.tbd */; };
17EBA2F6233B84F100935B37 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 17EBA2F5233B84F100935B37 /* libz.tbd */; };
27565E3ED9562FC294E1F030 /* libPods-playgroundTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EA462EB1E8B0C416F270389 /* libPods-playgroundTests.a */; };
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2DCD954D1E0B4F2C00145EB5 /* playgroundTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* playgroundTests.m */; };
64CABBCA0ACED25713144A37 /* libPods-playground.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 49DFD18A85D952855B872ECE /* libPods-playground.a */; };
940C756908BBDC5769A0EBEF /* libPods-playground-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA096EF8DC666BF02FECE745 /* libPods-playground-tvOSTests.a */; };
A96C8F2A9A25C051D20AF653 /* libPods-playground-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 847C32881789BDF2F0BDCF15 /* libPods-playground-tvOS.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = playground;
};
2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
remoteInfo = "playground-tvOS";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
00E356EE1AD99517003FC87E /* playgroundTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = playgroundTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* playgroundTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = playgroundTests.m; sourceTree = "<group>"; };
01D75AB81FA51F2FBD5DC09B /* Pods-playground.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground.debug.xcconfig"; path = "Target Support Files/Pods-playground/Pods-playground.debug.xcconfig"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* playground.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = playground.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = playground/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = playground/AppDelegate.m; sourceTree = "<group>"; };
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = playground/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = playground/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = playground/main.m; sourceTree = "<group>"; };
17EBA2ED233B84AB00935B37 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
17EBA2EF233B84CE00935B37 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
17EBA2F1233B84DC00935B37 /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
17EBA2F3233B84EA00935B37 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
17EBA2F5233B84F100935B37 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
2D02E47B1E0B4A5D006451C7 /* playground-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "playground-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* playground-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "playground-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2EA462EB1E8B0C416F270389 /* libPods-playgroundTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-playgroundTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
368F3BFB8DD62DF8B2D08776 /* Pods-playground-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground-tvOS.release.xcconfig"; path = "Target Support Files/Pods-playground-tvOS/Pods-playground-tvOS.release.xcconfig"; sourceTree = "<group>"; };
49DFD18A85D952855B872ECE /* libPods-playground.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-playground.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6CF1FE795DB2B330064FEBA7 /* Pods-playground.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground.release.xcconfig"; path = "Target Support Files/Pods-playground/Pods-playground.release.xcconfig"; sourceTree = "<group>"; };
7F687E3569C3D660D68A9BE2 /* Pods-playgroundTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playgroundTests.release.xcconfig"; path = "Target Support Files/Pods-playgroundTests/Pods-playgroundTests.release.xcconfig"; sourceTree = "<group>"; };
847C32881789BDF2F0BDCF15 /* libPods-playground-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-playground-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9D4EEF481830B40196A8D9CC /* Pods-playgroundTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playgroundTests.debug.xcconfig"; path = "Target Support Files/Pods-playgroundTests/Pods-playgroundTests.debug.xcconfig"; sourceTree = "<group>"; };
C12795556A9AF7EEFFDAEC32 /* Pods-playground-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-playground-tvOS/Pods-playground-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
C576C650FD20BB5BD201AC18 /* Pods-playground-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-playground-tvOSTests/Pods-playground-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
DA096EF8DC666BF02FECE745 /* libPods-playground-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-playground-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
F9E0B819CC2D1C3B6333ABE7 /* Pods-playground-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playground-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-playground-tvOSTests/Pods-playground-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
00E356EB1AD99517003FC87E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
27565E3ED9562FC294E1F030 /* libPods-playgroundTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
17EBA2F6233B84F100935B37 /* libz.tbd in Frameworks */,
17EBA2F4233B84EA00935B37 /* libc++.tbd in Frameworks */,
17EBA2F2233B84DC00935B37 /* libsqlite3.0.tbd in Frameworks */,
17EBA2F0233B84CE00935B37 /* CoreTelephony.framework in Frameworks */,
17EBA2EE233B84AB00935B37 /* SystemConfiguration.framework in Frameworks */,
64CABBCA0ACED25713144A37 /* libPods-playground.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2D02E4781E0B4A5D006451C7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A96C8F2A9A25C051D20AF653 /* libPods-playground-tvOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
940C756908BBDC5769A0EBEF /* libPods-playground-tvOSTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
00E356EF1AD99517003FC87E /* playgroundTests */ = {
isa = PBXGroup;
children = (
00E356F21AD99517003FC87E /* playgroundTests.m */,
00E356F01AD99517003FC87E /* Supporting Files */,
);
path = playgroundTests;
sourceTree = "<group>";
};
00E356F01AD99517003FC87E /* Supporting Files */ = {
isa = PBXGroup;
children = (
00E356F11AD99517003FC87E /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
13B07FAE1A68108700A75B9A /* playground */ = {
isa = PBXGroup;
children = (
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
13B07FB71A68108700A75B9A /* main.m */,
);
name = playground;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
17EBA2F5233B84F100935B37 /* libz.tbd */,
17EBA2F3233B84EA00935B37 /* libc++.tbd */,
17EBA2F1233B84DC00935B37 /* libsqlite3.0.tbd */,
17EBA2EF233B84CE00935B37 /* CoreTelephony.framework */,
17EBA2ED233B84AB00935B37 /* SystemConfiguration.framework */,
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
49DFD18A85D952855B872ECE /* libPods-playground.a */,
847C32881789BDF2F0BDCF15 /* libPods-playground-tvOS.a */,
DA096EF8DC666BF02FECE745 /* libPods-playground-tvOSTests.a */,
2EA462EB1E8B0C416F270389 /* libPods-playgroundTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
2FB09E0724A964B1E6A0F397 /* Pods */ = {
isa = PBXGroup;
children = (
01D75AB81FA51F2FBD5DC09B /* Pods-playground.debug.xcconfig */,
6CF1FE795DB2B330064FEBA7 /* Pods-playground.release.xcconfig */,
C12795556A9AF7EEFFDAEC32 /* Pods-playground-tvOS.debug.xcconfig */,
368F3BFB8DD62DF8B2D08776 /* Pods-playground-tvOS.release.xcconfig */,
F9E0B819CC2D1C3B6333ABE7 /* Pods-playground-tvOSTests.debug.xcconfig */,
C576C650FD20BB5BD201AC18 /* Pods-playground-tvOSTests.release.xcconfig */,
9D4EEF481830B40196A8D9CC /* Pods-playgroundTests.debug.xcconfig */,
7F687E3569C3D660D68A9BE2 /* Pods-playgroundTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
);
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* playground */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* playgroundTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
2FB09E0724A964B1E6A0F397 /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
tabWidth = 2;
usesTabs = 0;
};
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* playground.app */,
00E356EE1AD99517003FC87E /* playgroundTests.xctest */,
2D02E47B1E0B4A5D006451C7 /* playground-tvOS.app */,
2D02E4901E0B4A5D006451C7 /* playground-tvOSTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
00E356ED1AD99517003FC87E /* playgroundTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "playgroundTests" */;
buildPhases = (
940546D9A4E2DA78031BF783 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
);
buildRules = (
);
dependencies = (
00E356F51AD99517003FC87E /* PBXTargetDependency */,
);
name = playgroundTests;
productName = playgroundTests;
productReference = 00E356EE1AD99517003FC87E /* playgroundTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
13B07F861A680F5B00A75B9A /* playground */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "playground" */;
buildPhases = (
9EE9052471C95BA01AB430F0 /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
);
buildRules = (
);
dependencies = (
);
name = playground;
productName = playground;
productReference = 13B07F961A680F5B00A75B9A /* playground.app */;
productType = "com.apple.product-type.application";
};
2D02E47A1E0B4A5D006451C7 /* playground-tvOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "playground-tvOS" */;
buildPhases = (
54605AFA8F11532BA6257A9B /* [CP] Check Pods Manifest.lock */,
FD10A7F122414F3F0027D42C /* Start Packager */,
2D02E4771E0B4A5D006451C7 /* Sources */,
2D02E4781E0B4A5D006451C7 /* Frameworks */,
2D02E4791E0B4A5D006451C7 /* Resources */,
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,
);
buildRules = (
);
dependencies = (
);
name = "playground-tvOS";
productName = "playground-tvOS";
productReference = 2D02E47B1E0B4A5D006451C7 /* playground-tvOS.app */;
productType = "com.apple.product-type.application";
};
2D02E48F1E0B4A5D006451C7 /* playground-tvOSTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "playground-tvOSTests" */;
buildPhases = (
619804F7160C15D8AAD74169 /* [CP] Check Pods Manifest.lock */,
2D02E48C1E0B4A5D006451C7 /* Sources */,
2D02E48D1E0B4A5D006451C7 /* Frameworks */,
2D02E48E1E0B4A5D006451C7 /* Resources */,
);
buildRules = (
);
dependencies = (
2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,
);
name = "playground-tvOSTests";
productName = "playground-tvOSTests";
productReference = 2D02E4901E0B4A5D006451C7 /* playground-tvOSTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = YHU4Q7D53S;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = YHU4Q7D53S;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Automatic;
};
2D02E48F1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
ProvisioningStyle = Automatic;
TestTargetID = 2D02E47A1E0B4A5D006451C7;
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "playground" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* playground */,
00E356ED1AD99517003FC87E /* playgroundTests */,
2D02E47A1E0B4A5D006451C7 /* playground-tvOS */,
2D02E48F1E0B4A5D006451C7 /* playground-tvOSTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
00E356EC1AD99517003FC87E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8E1A680F5B00A75B9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2D02E4791E0B4A5D006451C7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2D02E48E1E0B4A5D006451C7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Bundle React Native Code And Images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
54605AFA8F11532BA6257A9B /* [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-playground-tvOS-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;
};
619804F7160C15D8AAD74169 /* [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-playground-tvOSTests-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;
};
940546D9A4E2DA78031BF783 /* [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-playgroundTests-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;
};
9EE9052471C95BA01AB430F0 /* [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-playground-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;
};
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;
};
FD10A7F122414F3F0027D42C /* 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 /* playgroundTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F871A680F5B00A75B9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2D02E4771E0B4A5D006451C7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2D02E48C1E0B4A5D006451C7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2DCD954D1E0B4F2C00145EB5 /* playgroundTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 13B07F861A680F5B00A75B9A /* playground */;
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
};
2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2D02E47A1E0B4A5D006451C7 /* playground-tvOS */;
targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
13B07FB21A68108700A75B9A /* Base */,
);
name = LaunchScreen.xib;
path = playground;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9D4EEF481830B40196A8D9CC /* Pods-playgroundTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = YHU4Q7D53S;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = playgroundTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
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)/playground.app/playground";
};
name = Debug;
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7F687E3569C3D660D68A9BE2 /* Pods-playgroundTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = YHU4Q7D53S;
INFOPLIST_FILE = playgroundTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
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)/playground.app/playground";
};
name = Release;
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 01D75AB81FA51F2FBD5DC09B /* Pods-playground.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = YHU4Q7D53S;
INFOPLIST_FILE = playground/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.playground.playground;
PRODUCT_NAME = playground;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 6CF1FE795DB2B330064FEBA7 /* Pods-playground.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YHU4Q7D53S;
INFOPLIST_FILE = playground/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.playground.playground;
PRODUCT_NAME = playground;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
2D02E4971E0B4A5E006451C7 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C12795556A9AF7EEFFDAEC32 /* Pods-playground-tvOS.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "playground-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.playground-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.2;
};
name = Debug;
};
2D02E4981E0B4A5E006451C7 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 368F3BFB8DD62DF8B2D08776 /* Pods-playground-tvOS.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "playground-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.playground-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.2;
};
name = Release;
};
2D02E4991E0B4A5E006451C7 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F9E0B819CC2D1C3B6333ABE7 /* Pods-playground-tvOSTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "playground-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.playground-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/playground-tvOS.app/playground-tvOS";
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Debug;
};
2D02E49A1E0B4A5E006451C7 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C576C650FD20BB5BD201AC18 /* Pods-playground-tvOSTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "playground-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.playground-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/playground-tvOS.app/playground-tvOS";
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Release;
};
83CBBA201A601CBA00E9B192 /* 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_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_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;
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 = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
83CBBA211A601CBA00E9B192 /* 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_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_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;
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 = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "playgroundTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
00E356F61AD99517003FC87E /* Debug */,
00E356F71AD99517003FC87E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "playground" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
13B07F951A680F5B00A75B9A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "playground-tvOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2D02E4971E0B4A5E006451C7 /* Debug */,
2D02E4981E0B4A5E006451C7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "playground-tvOSTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2D02E4991E0B4A5E006451C7 /* Debug */,
2D02E49A1E0B4A5E006451C7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "playground" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
83CBBA211A601CBA00E9B192 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
}

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D2A28121D9B038B00D4039D"
BuildableName = "libReact.a"
BlueprintName = "React-tvOS"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "playground-tvOS.app"
BlueprintName = "playground-tvOS"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "playground-tvOSTests.xctest"
BlueprintName = "playground-tvOSTests"
ReferencedContainer = "container:playground.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 = "2D02E48F1E0B4A5D006451C7"
BuildableName = "playground-tvOSTests.xctest"
BlueprintName = "playground-tvOSTests"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "playground-tvOS.app"
BlueprintName = "playground-tvOS"
ReferencedContainer = "container:playground.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">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "playground-tvOS.app"
BlueprintName = "playground-tvOS"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "playground-tvOS.app"
BlueprintName = "playground-tvOS"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "playground.app"
BlueprintName = "playground"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "playgroundTests.xctest"
BlueprintName = "playgroundTests"
ReferencedContainer = "container:playground.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 = "00E356ED1AD99517003FC87E"
BuildableName = "playgroundTests.xctest"
BlueprintName = "playgroundTests"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "playground.app"
BlueprintName = "playground"
ReferencedContainer = "container:playground.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">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "playground.app"
BlueprintName = "playground"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "playground.app"
BlueprintName = "playground"
ReferencedContainer = "container:playground.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:playground.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,15 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window;
@end

View File

@ -0,0 +1,49 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"playground"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
options:(NSDictionary<NSString*, id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
@end

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<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="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="playground" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>

View File

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

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,75 @@
<?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>CFBundleDisplayName</key>
<string>playground</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>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>appid</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wx13345678</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>wechat</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

View File

@ -0,0 +1,24 @@
<?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>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,68 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
@interface playgroundTests : XCTestCase
@end
@implementation playgroundTests
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
{
if (test(view)) {
return YES;
}
for (UIView *subview in [view subviews]) {
if ([self findSubviewInView:subview matching:test]) {
return YES;
}
}
return NO;
}
- (void)testRendersWelcomeScreen
{
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
BOOL foundElement = NO;
__block NSString *redboxError = nil;
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
if (level >= RCTLogLevelError) {
redboxError = message;
}
});
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
return YES;
}
return NO;
}];
}
RCTSetLogFunction(RCTDefaultLogFunction);
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
}
@end

View File

@ -0,0 +1,17 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};

28
playground/package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "playground",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.0",
"react-native-wechat": "^1.9.12"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.4.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}

6615
playground/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

BIN
weixin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

7
yarn.lock Normal file
View File

@ -0,0 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
events@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/events/-/events-1.0.2.tgz#75849dcfe93d10fb057c30055afdbd51d06a8e24"