|
|
@ -155,22 +155,29 @@ public class JPushPlugin implements MethodCallHandler {
|
|
|
|
public void scheduleCache() {
|
|
|
|
public void scheduleCache() {
|
|
|
|
Log.d(TAG,"scheduleCache:");
|
|
|
|
Log.d(TAG,"scheduleCache:");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Object> tempList = new ArrayList<Object>();
|
|
|
|
|
|
|
|
|
|
|
|
if (dartIsReady) {
|
|
|
|
if (dartIsReady) {
|
|
|
|
// try to shedule notifcation cache
|
|
|
|
// try to shedule notifcation cache
|
|
|
|
for (Map<String, Object> notification: JPushPlugin.openNotificationCache) {
|
|
|
|
List<Map<String, Object>> openNotificationCacheList = JPushPlugin.openNotificationCache;
|
|
|
|
|
|
|
|
for (Map<String, Object> notification: openNotificationCacheList) {
|
|
|
|
JPushPlugin.instance.channel.invokeMethod("onOpenNotification", notification);
|
|
|
|
JPushPlugin.instance.channel.invokeMethod("onOpenNotification", notification);
|
|
|
|
JPushPlugin.openNotificationCache.remove(notification);
|
|
|
|
tempList.add(notification);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
openNotificationCacheList.removeAll(tempList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String rid = JPushInterface.getRegistrationID(registrar.context());
|
|
|
|
String rid = JPushInterface.getRegistrationID(registrar.context());
|
|
|
|
boolean ridAvailable = rid != null && !rid.isEmpty();
|
|
|
|
boolean ridAvailable = rid != null && !rid.isEmpty();
|
|
|
|
if (ridAvailable && dartIsReady) {
|
|
|
|
if (ridAvailable && dartIsReady) {
|
|
|
|
// try to schedule get rid cache
|
|
|
|
// try to schedule get rid cache
|
|
|
|
for (Result res: JPushPlugin.instance.getRidCache) {
|
|
|
|
tempList.clear();
|
|
|
|
|
|
|
|
List<Result> resultList = JPushPlugin.instance.getRidCache;
|
|
|
|
|
|
|
|
for (Result res: resultList) {
|
|
|
|
Log.d(TAG,"scheduleCache rid = " + rid);
|
|
|
|
Log.d(TAG,"scheduleCache rid = " + rid);
|
|
|
|
res.success(rid);
|
|
|
|
res.success(rid);
|
|
|
|
JPushPlugin.instance.getRidCache.remove(res);
|
|
|
|
tempList.add(res);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resultList.removeAll(tempList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|