Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

版本问题该如何解决? #3

Open
tom0gao opened this issue Sep 4, 2018 · 4 comments
Open

版本问题该如何解决? #3

tom0gao opened this issue Sep 4, 2018 · 4 comments

Comments

@tom0gao
Copy link

tom0gao commented Sep 4, 2018

The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.

Because lian_miao depends on flutter_jpush from git which requires SDK version <2.0.0, version solving failed.
版本问题该如何解决?

@tom0gao
Copy link
Author

tom0gao commented Sep 4, 2018

在构造JPushNotification时为android平台时 参数传递不全

@jzoom
Copy link
Member

jzoom commented Sep 6, 2018

已经上到pub了,

environment:
  sdk: ">=2.0.0-dev.48.0 <3.0.0"
  flutter: ">=0.1.4 <3.0.0"

依赖是这样的

@jzoom
Copy link
Member

jzoom commented Sep 6, 2018

参数哪里不全,能指出来吗

@tom0gao
Copy link
Author

tom0gao commented Sep 7, 2018

这个是我改后的 可能参数还不是很全,主要是android 没有传extras 回来 我发现在构造里面 取值赋值会出现 值为null 所以改为了在外面接好值再去赋值

factory JPushNotification.fromMap(dynamic dic, bool fromOpen) {
print("Enter new ");
try {
if (Platform.isIOS) {
dynamic aps = dic['aps'];
String appState = dic['appState'];
AppState state;
switch (appState) {
case 'inactive':
state = AppState.inactive;
break;
case 'active':
state = AppState.active;
break;
case 'background':
state = AppState.background;
break;
}
dynamic alert = aps['alert'];
String content;
String title;
String subtitle;
if (alert is String) {
content = alert;
} else {
title = alert['title'];
content = alert['body'];
subtitle = alert['subtitle'];
}
var badge = aps['badge'] as int;
var sound = aps['sound'];
var extras = dic['extras'];
var id = dic['_j_msgid'];
return new JPushNotification(
title: title,
badge: badge,
content: content,
sound: sound,
extras: extras,
subtitle: subtitle,
appState: state,
id: id,
fromOpen: fromOpen,
fireTime: new DateTime.now());
} else {
String content = dic['alertContent'];
var extras = dic['extras'];
var id = dic['id'] as int;
var alertType = dic['alertType'] as int;
return new JPushNotification(
alertType: alertType,
content: content,
id: id,
extras: extras,
fromOpen: fromOpen,
fireTime: new DateTime.now(),
);
}
} catch (e) {
print(e);
return new JPushNotification();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants