An open API service indexing awesome lists of open source software.

https://github.com/puti94/react-native-pgyer-bridge

react-native 蒲公英插件
https://github.com/puti94/react-native-pgyer-bridge

android ios pyger react-native

Last synced: 28 days ago
JSON representation

react-native 蒲公英插件

Awesome Lists containing this project

README

        

# react-native-pgyer-bridge

## 介绍

桥接[蒲公英](!https://www.pgyer.com/doc)的sdk,以便使用蒲公英的更新检查,bug反馈,异常检测功能,可以直接在蒲公英应用管理端查看。对于公司没有详细测试流程的可以接入。

## 使用场景
- 测试人员可以摇一摇反馈bug
![avatar](img/android_back.png)
![avatar](img/ios_back.png)
- 检查更新,有更新就会自动安装
![avatar](img/android_update.png)
![avatar](img/android_down.png)
![avatar](img/android_install.png)
![avatar](img/ios_update.png)
- 后台查看
![avatar](img/feed_back.png)
![avatar](img/crash.png)
## Getting started

`$ npm install react-native-pgyer-bridge --save` or `$ yarn add react-native-pgyer-bridge`

### Mostly automatic installation

`$ react-native link react-native-pgyer-bridge`

### Manual installation

#### iOS

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-pgyer-bridge` and add `RNPgyerBridge.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNPgyerBridge.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<

#### Android

1. Open up `android/app/src/main/java/[...]/MainActivity.java`
- Add `import com.reactlibrary.RNPgyerBridgePackage;` to the imports at the top of the file
- Add `new RNPgyerBridgePackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
```
include ':react-native-pgyer-bridge'
project(':react-native-pgyer-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pgyer-bridge/android')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-pgyer-bridge')
```
### 配置项
- ios 切换到 Build Phases选项卡中,在 Link Binary With Libraries 中添加如下六个系统 framework
```xml
CoreTelephony.framework
OpenGLES.framework
CoreMotion.framework
AudioToolbox.framework
AvFoundation.framework
SystemConfiguration.framework
```
- 安卓配置 AndroidManifest
```xml







// Android9.0 需要配置允许 SDK http请求配置:
// network_security_config.xml 文件


www.pgyer.com
app-global.pgyer.com

```
## Usage
```javascript
import Pgyer from 'react-native-pgyer-bridge';
//在入口处初始化蒲公英,appId为蒲公英上传安装包后应用的appKey
Pgyer.initWithConfig({appId:'xxx'});
//简单的检查更新
Pgyer.checkUpdate();
//截图并且显示反馈弹窗
Pgyer.showFeedbackView();
//获取更新信息
Pgyer.getUpdateInfo();
//自动发送错误日志,ios官方sdkapi有问题,安卓有效
Pgyer.reportException({
name: 'MY IS CUSTOM EXCEPTION',
reason: "CUSTOM",
userInfo: {
aa: "21321",
bb: "sadsad",
cc: {aa: 'SAD21321321'}
}
})
//更多详细的用法可以看example

```