You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.3 KiB

6 years ago
[![QQ Group](https://img.shields.io/badge/QQ%20Group-862401307-red.svg)]()
6 years ago
# JPush Flutter Plugin
6 years ago
### 安装
在工程 pubspec.yaml 中加入 dependencies
5 years ago
```
5 years ago
5 years ago
//github 集成
5 years ago
dependencies:
jpush_flutter:
5 years ago
git:
url: git://github.com/jpush/jpush-flutter-plugin.git
5 years ago
ref: master
5 years ago
// pub 集成
dependencies:
jpush_flutter: 0.5.7
6 years ago
```
### 配置
##### Android:
`/android/app/build.gradle` 中添加下列代码:
```groovy
android: {
....
defaultConfig {
6 years ago
applicationId "替换成自己应用 ID"
6 years ago
...
ndk {
6 years ago
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a',
6 years ago
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
6 years ago
JPUSH_APPKEY : "appkey", // NOTE: JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
6 years ago
]
6 years ago
}
}
```
##### iOS:
- 在 xcode8 之后需要点开推送选项: TARGETS -> Capabilities -> Push Notification 设为 on 状态
### 使用
```dart
import 'package:jpush_flutter/jpush_flutter.dart';
```
### APIs
6 years ago
**注意** : 需要先调用 JPush.setup 来初始化插件,才能保证其他功能正常工作。
6 years ago
6 years ago
[参考](./documents/APIs.md)