Comments (4)
在构造JPushNotification时为android平台时 参数传递不全
from flutter_jpush.
已经上到pub了,
environment:
sdk: ">=2.0.0-dev.48.0 <3.0.0"
flutter: ">=0.1.4 <3.0.0"
依赖是这样的
from flutter_jpush.
参数哪里不全,能指出来吗
from flutter_jpush.
这个是我改后的 可能参数还不是很全,主要是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();
}
}
from flutter_jpush.
Related Issues (20)
- 怎么修改在通知栏显示中文名字
- 如何锁屏后通知亮屏,提示时有通知声音,震动,弹出框,呼吸灯等
- AppDelegate.swift 怎么集成key HOT 2
- 消息可以推送,但是点击消息会造成app闪退(安卓)
- example运行起来后报错,我把代码集成到项目以后,setAlias同样报错 HOT 4
- When ios is in non-startup state of app
- 获取不到设备号,求助,主动获取无法拿到,添加监听addnetworkDidLoginListener,没有走该方法
- setAlias 没有东西返回 HOT 1
- 通知栏上有点击事件吗
- 安装出现如下问题
- AppDelegate.swift 中怎么初始化 HOT 1
- debug下 运行项目闪退(iOS) HOT 1
- 获取别名,程序崩溃
- 设置别名setAlias报错,不管在哪里设置都报错 HOT 1
- ios上有通知栏,但收不到消息,点击通知栏才可以获取消息,如何在有通知栏时获取到消息
- Android5.1 设置标签跟别名闪退
- HUAWEI nova 3e, android 9,EMUI 9.1.0, 能收到推送,但是onReceiveNotification 和onReceiveMessage 回调不执行
- 怎么集成到项目里啊,添加依赖(dependences) HOT 1
- 请问 FlutterJPush.addReceiveCustomMsgListener 之后接收不到消息是怎么回事呐?
- 调试模式启动时app直接退出 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_jpush.