起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1463|回复: 2

[结贴] 怎么使用APP原生方法,把消息显示在手机通知栏

[复制链接]

213

主题

790

帖子

2056

积分

金牌会员

Rank: 6Rank: 6

积分
2056
QQ
发表于 2018-7-3 22:07:49 | 显示全部楼层 |阅读模式
Notification.Builder builder2=new Notification.Builder(this);
          Intent intent2=new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.jianshu.com/p/82e249713f1b"));
          PendingIntent pendingIntent2=PendingIntent.getActivity(this,0,intent2,0);
          builder2.setContentIntent(pendingIntent2);
          builder2.setSmallIcon(R.mipmap.ic_launcher);
          builder2.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher));
          builder2.setAutoCancel(true);
          builder2.setContentTitle("折叠通知");

          RemoteViews remoteViews=new RemoteViews(getPackageName(),R.layout.layout_view);
          Notification  notification=builder2.build();
          notification.bigContentView=remoteViews;
          mNotificationManager.notify(1,notification);


在wex5  中 报错
发表于 2018-7-5 13:11:45 | 显示全部楼层
用 corodva插件
cordova.plugin.local-notification

参考案例
/UI2/demo/plugin/notification/demo.w
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

213

主题

790

帖子

2056

积分

金牌会员

Rank: 6Rank: 6

积分
2056
QQ
 楼主| 发表于 2018-7-5 15:22:53 | 显示全部楼层
谢谢 结帖
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-9-25 05:29 , Processed in 0.089666 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表