@dcloudio/uni-push 3.0.0-alpha-3050520220824001 → 3.0.0-alpha-3060020220830002

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -133,22 +133,6 @@ function initPushNotification() {
133
133
  },
134
134
  });
135
135
  });
136
- plus.push.addEventListener('click', (result) => {
137
- // @ts-expect-error
138
- uni.invokePushCallback({
139
- type: 'click',
140
- message: result,
141
- });
142
- });
143
- uni.onPushMessage((res) => {
144
- if (res.type === 'receive' &&
145
- res.data &&
146
- res.data.force_notification) {
147
- // 创建通知栏
148
- uni.createPushMessage(res.data);
149
- res.stopped = true;
150
- }
151
- });
152
136
  }
153
137
  }
154
138
 
@@ -207,4 +191,16 @@ else {
207
191
  });
208
192
  },
209
193
  });
194
+ // 仅在 jssdk 中监听
195
+ // #ifdef APP
196
+ uni.onPushMessage((res) => {
197
+ if (res.type === 'receive' &&
198
+ res.data &&
199
+ res.data.force_notification) {
200
+ // 创建通知栏
201
+ uni.createPushMessage(res.data);
202
+ res.stopped = true;
203
+ }
204
+ });
205
+ // #endif
210
206
  }
@@ -31,22 +31,6 @@ function initPushNotification() {
31
31
  },
32
32
  });
33
33
  });
34
- plus.push.addEventListener('click', (result) => {
35
- // @ts-expect-error
36
- uni.invokePushCallback({
37
- type: 'click',
38
- message: result,
39
- });
40
- });
41
- uni.onPushMessage((res) => {
42
- if (res.type === 'receive' &&
43
- res.data &&
44
- res.data.force_notification) {
45
- // 创建通知栏
46
- uni.createPushMessage(res.data);
47
- res.stopped = true;
48
- }
49
- });
50
34
  }
51
35
  }
52
36
 
@@ -58,11 +42,4 @@ uni.invokePushCallback({
58
42
  Promise.resolve().then(() => {
59
43
  initPushNotification();
60
44
  plus.push.setAutoNotification && plus.push.setAutoNotification(false);
61
- plus.push.addEventListener('receive', (result) => {
62
- // @ts-expect-error
63
- uni.invokePushCallback({
64
- type: 'pushMsg',
65
- message: result,
66
- });
67
- });
68
45
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-push",
3
- "version": "3.0.0-alpha-3050520220824001",
3
+ "version": "3.0.0-alpha-3060020220830002",
4
4
  "description": "@dcloudio/uni-push",
5
5
  "main": "lib/uni-push.js",
6
6
  "module": "lib/uni-push.js",
@@ -20,6 +20,6 @@
20
20
  },
21
21
  "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
22
22
  "dependencies": {
23
- "@dcloudio/uni-cli-shared": "3.0.0-alpha-3050520220824001"
23
+ "@dcloudio/uni-cli-shared": "3.0.0-alpha-3060020220830002"
24
24
  }
25
25
  }