From 292618728f4aba07c82194d5191386b4ec15e533 Mon Sep 17 00:00:00 2001 From: "qingqing.wang" Date: Sun, 27 Sep 2020 09:54:54 +0800 Subject: [PATCH] =?UTF-8?q?0.6.0=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ README.md | 2 +- .../main/java/com/jiguang/jpush/JPushPlugin.java | 15 +++++++++++---- pubspec.yaml | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af2ac00..c841d6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.6.0 ++ 修复:修复已知bug ## 0.5.9 + 适配最新版本 JPush SDK Android 3.8.0 , IOS 3.3.6 ## 0.5.6 diff --git a/README.md b/README.md index 5f3e762..3c43330 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ dependencies: // pub 集成 dependencies: - jpush_flutter: 0.5.9 + jpush_flutter: 0.6.0 ``` ### 配置 diff --git a/android/src/main/java/com/jiguang/jpush/JPushPlugin.java b/android/src/main/java/com/jiguang/jpush/JPushPlugin.java index 01bdb1c..2edaf71 100644 --- a/android/src/main/java/com/jiguang/jpush/JPushPlugin.java +++ b/android/src/main/java/com/jiguang/jpush/JPushPlugin.java @@ -155,22 +155,29 @@ public class JPushPlugin implements MethodCallHandler { public void scheduleCache() { Log.d(TAG,"scheduleCache:"); + List tempList = new ArrayList(); + if (dartIsReady) { // try to shedule notifcation cache - for (Map notification: JPushPlugin.openNotificationCache) { + List> openNotificationCacheList = JPushPlugin.openNotificationCache; + for (Map notification: openNotificationCacheList) { JPushPlugin.instance.channel.invokeMethod("onOpenNotification", notification); - JPushPlugin.openNotificationCache.remove(notification); + tempList.add(notification); } + openNotificationCacheList.removeAll(tempList); } String rid = JPushInterface.getRegistrationID(registrar.context()); boolean ridAvailable = rid != null && !rid.isEmpty(); if (ridAvailable && dartIsReady) { // try to schedule get rid cache - for (Result res: JPushPlugin.instance.getRidCache) { + tempList.clear(); + List resultList = JPushPlugin.instance.getRidCache; + for (Result res: resultList) { Log.d(TAG,"scheduleCache rid = " + rid); res.success(rid); - JPushPlugin.instance.getRidCache.remove(res); + tempList.add(res); } + resultList.removeAll(tempList); } } diff --git a/pubspec.yaml b/pubspec.yaml index b9cb2ba..adb1b31 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: jpush_flutter description: JIGUANG officially supported JPush Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)(https://www.jiguang.cn). -version: 0.5.9 +version: 0.6.0 # author: xudong.rao homepage: https://www.jiguang.cn