From a31ec43ce77c0a51f07698dfb66cd55310d0fac8 Mon Sep 17 00:00:00 2001 From: huangminlinux <380108184@qq.com> Date: Tue, 18 Sep 2018 19:04:59 +0800 Subject: [PATCH] udpate readme --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b5a74b5..779ea6e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,54 @@ -# jpush +# JPush Flutter Plugin +### 安装 + +在工程 pubspec.yaml 中加入 dependencies + +```yaml +dependencies: + jpush_flutter: '>=0.0.1' +``` + +### 配置 + +##### Android: + +在 `/android/app/build.gradle` 中添加下列代码: + +```groovy +android: { + .... + defaultConfig { + applicationId "com.example.huminios.jpushtest" + ... + ndk { + //选择要添加的对应 cpu 类型的 .so 库。 + abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64' // 'arm64-v8a', + } + + manifestPlaceholders = [ + JPUSH_PKGNAME : applicationId, + JPUSH_APPKEY : "appkey", // NOTE: JPush 上注册的包名对应的 Appkey. + JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. + ] + } +} + +``` + +##### iOS: + +- 在 iOS 工程中设置 TARGETS-> BUILD Phases -> LinkBinary with Libraries 找到 UserNotifications.framework 把 status 设为 optional +- 在 xcode8 之后需要点开推送选项: TARGETS -> Capabilities -> Push Notification 设为 on 状态 + +### 使用 + +```dart +import 'package:jpush_flutter/jpush_flutter.dart'; +``` + +### APIs + +**注意:**需要先调用 JPush.setup 来初始化插件,才能保证其他功能正常工作。 + + [参考](./lib/jpush_flutter.dart) \ No newline at end of file