Skip to content

Commit d0a8007

Browse files
committed
update to 0.0.5
1 parent 4e0cf44 commit d0a8007

File tree

11 files changed

+624
-80
lines changed

11 files changed

+624
-80
lines changed

.packages

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,56 @@
1-
# Generated by pub on 2018-09-29 10:15:14.625856.
1+
# Generated by pub on 2018-10-08 23:40:55.475551.
2+
analyzer:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.33.0/lib/
3+
args:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.0/lib/
4+
async:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/
5+
boolean_selector:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
6+
charcode:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
27
collection:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.14.11/lib/
8+
convert:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.0.2/lib/
9+
crypto:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.0.6/lib/
10+
csslib:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/csslib-0.14.6/lib/
311
flutter:file:///Applications/flutter/packages/flutter/lib/
12+
front_end:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.6/lib/
13+
glob:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/glob-1.1.7/lib/
14+
html:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/html-0.13.3+3/lib/
15+
http:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.0/lib/
16+
http_multi_server:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.0.5/lib/
17+
http_parser:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/
18+
io:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/io-0.3.3/lib/
19+
js:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.1+1/lib/
20+
json_rpc_2:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/json_rpc_2-2.0.9/lib/
21+
kernel:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/kernel-0.3.6/lib/
22+
logging:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/logging-0.11.3+2/lib/
23+
matcher:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.3+1/lib/
424
meta:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.1.6/lib/
25+
mime:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/mime-0.9.6+2/lib/
26+
mockito:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/mockito-3.0.0/lib/
27+
multi_server_socket:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/multi_server_socket-1.0.2/lib/
28+
node_preamble:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/node_preamble-1.4.4/lib/
29+
package_config:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-1.0.5/lib/
30+
package_resolver:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/package_resolver-1.0.6/lib/
31+
path:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.6.2/lib/
32+
platform:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/platform-2.2.0/lib/
33+
plugin:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/plugin-0.2.0+3/lib/
34+
pool:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.3.6/lib/
35+
pub_semver:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-1.4.2/lib/
36+
shelf:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-0.7.3+3/lib/
37+
shelf_packages_handler:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-1.0.4/lib/
38+
shelf_static:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-0.2.8/lib/
39+
shelf_web_socket:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-0.2.2+4/lib/
540
sky_engine:file:///Applications/flutter/bin/cache/pkg/sky_engine/lib/
41+
source_map_stack_trace:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/source_map_stack_trace-1.1.5/lib/
42+
source_maps:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/source_maps-0.10.8/lib/
43+
source_span:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.4.1/lib/
44+
stack_trace:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/
45+
stream_channel:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-1.6.8/lib/
46+
string_scanner:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.4/lib/
47+
term_glyph:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.0.1/lib/
48+
test:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.3.4/lib/
649
typed_data:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/
50+
utf:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/utf-0.9.0+5/lib/
751
vector_math:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/
52+
vm_service_client:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service_client-0.2.6/lib/
53+
watcher:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-0.9.7+10/lib/
54+
web_socket_channel:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-1.0.9/lib/
55+
yaml:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/yaml-2.1.15/lib/
856
jpush_flutter:lib/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
```yaml
99
dependencies:
10-
jpush_flutter: 0.0.3
10+
jpush_flutter: 0.0.5
1111
```
1212
1313
### 配置

documents/APIs.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
添加事件监听方法。
2929

3030
```dart
31-
JPush.addEventHandler(
31+
JPush jpush = new JPush();
32+
jpush.addEventHandler(
3233
// 接收通知回调方法。
3334
onReceiveNotification: (Map<String, dynamic> message) async {
3435
print("flutter onReceiveNotification: $message");
@@ -52,7 +53,8 @@ JPush.addEventHandler(
5253
- 将缓存的事件下发到 dart 环境中。
5354

5455
```dart
55-
JPush.setup(
56+
JPush jpush = new JPush();
57+
jpush.setup(
5658
appKey: "替换成你自己的 appKey",
5759
channel: "theChannel",
5860
production: false
@@ -64,79 +66,88 @@ JPush.setup(
6466
获取 registrationId,这个 JPush 运行通过 registrationId 来进行推送.
6567

6668
```dart
67-
JPush.getRegistrationID().then((rid) { });
69+
JPush jpush = new JPush();
70+
jpush.getRegistrationID().then((rid) { });
6871
```
6972

7073
#### stopPush
7174

7275
停止推送功能,调用该方法将不会接收到通知。
7376

7477
```dart
75-
JPush.stopPush();
78+
JPush jpush = new JPush();
79+
jpush.stopPush();
7680
```
7781

7882
#### resumePush
7983

8084
调用 stopPush 后,可以通过 resumePush 方法恢复推送。
8185

8286
```dart
83-
JPush.resumePush();
87+
JPush jpush = new JPush();
88+
jpush.resumePush();
8489
```
8590

8691
#### setAlias
8792

8893
设置别名,极光后台可以通过别名来推送,一个 App 应用只有一个别名,一般用来存储用户 id。
8994

9095
```
91-
JPush.setAlias("your alias").then((map) { });
96+
JPush jpush = new JPush();
97+
jpush.setAlias("your alias").then((map) { });
9298
```
9399

94100
#### deleteAlias
95101

96102
可以通过 deleteAlias 方法来删除已经设置的 alias。
97103

98104
```dart
99-
JPush.deleteAlias().then((map) {})
105+
JPush jpush = new JPush();
106+
jpush.deleteAlias().then((map) {})
100107
```
101108

102109
#### addTags
103110

104111
在原来的 Tags 列表上添加指定 tags。
105112

106113
```
107-
JPush.addTags(["tag1","tag2"]).then((map) {});
114+
JPush jpush = new JPush();
115+
jpush.addTags(["tag1","tag2"]).then((map) {});
108116
```
109117

110118
#### deleteTags
111119

112120
在原来的 Tags 列表上删除指定 tags。
113121

114122
```
115-
JPush.deleteTags(["tag1","tag2"]).then((map) {});
123+
JPush jpush = new JPush();
124+
jpush.deleteTags(["tag1","tag2"]).then((map) {});
116125
```
117126

118127
#### setTags
119128

120129
重置 tags。
121130

122-
```
123-
JPush.setTags(["tag1","tag2"]).then((map) {});
131+
```dart
132+
JPush jpush = new JPush();
133+
jpush.setTags(["tag1","tag2"]).then((map) {});
124134
```
125135

126136
#### cleanTags
127137

128138
清空所有 tags
129139

130140
```dart
131-
JPush.setTags().then((map) {});
141+
jpush.setTags().then((map) {});
132142
```
133143

134144
#### getAllTags
135145

136146
获取当前 tags 列表。
137147

138-
```
139-
JPush.getAllTags().then((map) {});
148+
```dart
149+
JPush jpush = new JPush();
150+
jpush.getAllTags().then((map) {});
140151
```
141152

142153
#### sendLocalNotification
@@ -145,6 +156,7 @@ JPush.getAllTags().then((map) {});
145156

146157
```dart
147158
// 延时 3 秒后触发本地通知。
159+
JPush jpush = new JPush();
148160
var fireDate = DateTime.fromMillisecondsSinceEpoch(DateTime.now().millisecondsSinceEpoch + 3000);
149161
var localNotification = LocalNotification(
150162
id: 234,
@@ -156,15 +168,16 @@ var localNotification = LocalNotification(
156168
badge: 5, // 该参数只有在 iOS 有效
157169
extras: {"fa": "0"} // 设置 extras ,extras 需要是 Map<String, String>
158170
);
159-
JPush.sendLocalNotification(localNotification).then((res) {});
171+
jpush.sendLocalNotification(localNotification).then((res) {});
160172
```
161173

162174
#### clearAllNotifications
163175

164176
清楚通知栏上所有通知。
165177

166178
```dart
167-
JPush.clearAllNotifications();
179+
JPush jpush = new JPush();
180+
jpush.clearAllNotifications();
168181
```
169182

170183
#### applyPushAuthority
@@ -174,7 +187,8 @@ JPush.clearAllNotifications();
174187
**注意: iOS10+ 可以通过该方法来设置推送是否前台展示,是否触发声音,是否设置应用角标 badge**
175188

176189
```dart
177-
JPush.applyPushAuthority(new NotificationSettingsIOS(
190+
JPush jpush = new JPush();
191+
jpush.applyPushAuthority(new NotificationSettingsIOS(
178192
sound: true,
179193
alert: true,
180194
badge: true));
@@ -187,14 +201,16 @@ JPush.applyPushAuthority(new NotificationSettingsIOS(
187201
设置应用 badge 值,该方法还会同步 JPush 服务器的的 badge 值,JPush 服务器的 badge 值用于推送 badge 自动 +1 时会用到。
188202

189203
```dart
190-
JPush.setBadge(66).then((map) {});
204+
JPush jpush = new JPush();
205+
jpush.setBadge(66).then((map) {});
191206
```
192207

193208
### getLaunchAppNotification
194209

195210
获取 iOS 点击推送启动应用的那条通知。
196211

197212
```dart
198-
JPush.getLaunchAppNotification().then((map) {});
213+
JPush jpush = new JPush();
214+
jpush.getLaunchAppNotification().then((map) {});
199215
```
200216

0 commit comments

Comments
 (0)