草庐IT

notification1

全部标签

android - Lollipop : heads-up notification is canceled when clicked

我已经搜索了很长时间,但找不到答案。我的应用程序显示带有Notification.PRIORITY_HIGH的通知这导致它在Lollipop上显示为提醒通知。问题是,当点击通知本身(即启动它的contentIntent)时,通知会自动清除,即使Notification.FLAG_AUTO_CANCEL也是如此。未设置并且通知有Notification.FLAG_NO_CANCEL放。我尝试了各种标志组合,包括Notification.FLAG_ONGOING_EVENT但行为保持不变。我希望通知成为“正常”通知,而不是被取消...关于如何解决这个问题的任何想法?文档在这个问题上根本不清

安卓 "Could not find method android.app.Notification$Builder.setLocalOnly "

我是Android新手。现在,我正在测试GoogleAnalytics,我遇到了以下日志:Couldnotfindmethodandroid.app.Notification$Builder.setLocalOnly,referencedfrommethodcom.google.android.gms.common.GooglePlayServicesUtil.zza什么意思,我必须做什么? 最佳答案 setLocalOnly在API级别20及以上上可用。我可以知道您是否将Android支持库v4或AppCompatv7添加到您的应

android - Urban Airship : custom icon for default status bar notification

如果您想对状态栏通知进行任何修改,包括微调图标,UrbanAirship建议使用CustomPushNotificationBuilder创建自定义通知。不幸的是,使用RemoteView进行通知会带来许多与自定义制造商和/或特定于平台的皮肤相关的不良影响,includingtextcolors以及对私有(private)资源的引用(例如Honeycomb/ICS上的@*android:drawable/notify_panel_notification_icon_bg_tile)。必须有一种无需使用RemoteView即可交换图标的简单方法。怎么办? 最佳

消息通知(Notification)/用户触达系统设计

近年来,通知功能已经成为许多应用程序中突出的特性。构建一个能每天发送数百万通知的可扩展系统绝非易事。这正是为什么我觉得有必要记录我在这方面踩坑之路。也叫用户触达系统。完成这项任务要求对通知生态系统有深刻的理解,否则需求很容易变得模糊和不明确。1了解通知系统并确定设计范围通知是用于向用户提供重要信息的一种方式,如产品更新、提醒事件、优惠等。已成为应用功能清单中的重要组成部分。通知不仅是移动推送通知。通常,根据接收者的特征1通知格式分类移动推送通知短信电子邮件网页推送通知第三方应用通知(类似Slack、钉钉的应用)2功能需求系统支持推送通知、短信、电子邮件和第三方应用通知。准实时系统。希望用户尽快

android - 为什么 Eclipse 无法识别 Notification.Builder 类中的 build() 方法来返回 Notification 对象?

这是我的代码:NotificationManagermNotificationManager=(NotificationManager)c.getSystemService(ns);//InstantiatethenotificationCharSequencetickerText="Hello";longwhen=System.currentTimeMillis();Notification.Builderbuilder=newNotification.Builder(c).setTicker(tickerText).setWhen(when).setContentTitle("Te

java - 如何从 Firebase Push Notification 获取数据并将其显示在您的 Android Activity 中?

抱歉这个菜鸟问题,我是android开发的新手。我目前正在开展一个项目,该项目需要向安装了我的应用程序的Android设备发送推送通知。我已经按照firebase的快速入门教程完成了此操作,并在我的设备上成功收到了通知。问题:如何检索服务器发送的消息并将该消息显示到我的AndroidActivity?提前致谢。这是我的代码。MainActivity.javapublicclassMainActivityextendsAppCompatActivity{TextViewtextView;@OverrideprotectedvoidonCreate(BundlesavedInstanceS

安卓 : Unable to display multiple lines of text in Notification

我试图在通知中使用BigTextStyle显示多行文本,但无法这样做。我正在使用下面的代码。publicvoidsendNotification(Viewview){StringmsgText="JeallyBeanNotificationexample!!"+"whereyouwillseethreedifferentkindofnotification."+"youcanevenputtheverylongstringhere.";NotificationManagernotificationManager=getNotificationManager();PendingInten

android - 无法将支持 v4 MediaSession token 与 Notification MediaStyle.setMediaSession 一起使用

我正在编写一些Android代码,我不想构建MediaStyle通知。我已经将AppCompat用于m媒体播放器和媒体session的大部分,而我还没有使用的部分我计划进行切换,以便保持4.x兼容性。问题?好吧,我正在尝试制作我的MediaStyle通知,并给它一个MediaSessiontoken。我的support.v4.media.session.MediaSession.Token似乎与media.session.MediaSession.Token不兼容我已经尝试过类型转换,只是保持原始状态。老实说,我很困惑,因为文档说它们是兼容的。如果你想要剩下的代码,codecanbef

android - Firebase 的云功能 : Sending topic notification to Android device not working

我正在关注Udacity的这个教程,其中CloudFunctionsforFirebase用于更改添加数据的引用数据。我想使用类似的功能,但用于向订阅主题的用户发送推送通知。这是我正在使用的功能。constfunctions=require('firebase-functions');constadmin=require('firebase-admin');admin.initializeApp(functions.config().firebase);exports.sendNotification=functions.database.ref('/messages/{pushId}

安卓奥利奥 : Grouped Notifications With Notification Channels

我遵循了提供的文档here并且可以在AndroidN及更高版本上成功创建通知组。然而,我遇到的问题是AndroidOreo,每个发布到群组的通知都会为群组播放声音。这很烦人,因为我只想播放一次声音。每个单独的通知都是用户在他们所在的每个聊天室中尚未阅读的聊天的摘要。当有多个聊天室有未读消息时,我需要分组。似乎没有办法动态设置通知的声音,它仅限于channel创建。我尝试遵循DanLew的建议here但通知声音仍会为每个通知播放。因此,我的问题是,如何在AndroidOreo中获得分组通知而不为每个通知播放声音? 最佳答案 我整整一周