简体   繁体   English

如何在android中显示本地推送通知(在主屏幕上的应用程序图标,如i-phone)

[英]how to show local push notification (on app icon on home screen like i-phone) in android

I am given a task to show local push notification. 我有一个任务显示本地推送通知。 I have successfully completed showing push notification on bar. 我已成功完成在栏上显示推送通知。 But also I have to show local notification on app launching icon on home screen like in i-phone. 但是我也必须在主屏幕上显示关于app启动图标的本地通知,就像在i-phone中一样。 See the image 看图像 在此输入图像描述

I want this kind of notification. 我想要这种通知。 Here, may be the dialog I create using custom AlertDialog. 这里,可能是我使用自定义AlertDialog创建的对话框。 But I'm stuck with the notification on the app icon ie that bubble containing notification no on upper right corner of app icon. 但是我坚持使用应用程序图标上的通知,即在应用程序图标的右上角包含通知no的气泡。 I think this functionality is not given by android sdk. 我认为这个功能不是由android sdk给出的。 but our client says that she has seen these kinds of notifications on her Android mobile for some applications. 但我们的客户说,她已经在她的Android手机上看到过某些应用程序的这类通知。 So is it possible in Android, and if yes then how to do it? 那么在Android中是否可能,如果是,那该怎么做呢?

What you're looking for is a "badge" and I'm sorry to tell you that this does not exist on Android - your client must be mistaken. 您正在寻找的是一个“徽章”,我很遗憾地告诉您,这在Android上不存在 - 您的客户端必定是错误的。

One workaround you could do is to create a widget for your app (and you can even make it look like an app icon if you wish...), and you can add a badge or update how it looks any way you choose. 您可以做的一个解决方法是为您的应用创建一个小部件(如果您愿意,您甚至可以使其看起来像应用程序图标),并且您可以添加徽章或更新它的外观以您选择的方式。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android的主屏幕上的我的应用程序图标上显示通知计数 - How to show Notification Count on My App Icon on Home Screen in Android 如何以编程方式在Android上的应用程序图标上显示推送通知徽章计数? - How to show push notification badge count on app icon in android programmatically? 适用于Android的I-Phone VM - I-Phone VM for Android 如何检查活动是从通知启动还是从用户单击 android 中的主屏幕仪表板应用程序图标启动 - how to check whether the activity was launched from notification or from the user click on home screen dashboard app icon in android 我们如何在Android中以编程方式为“锁定屏幕通知和徽章图标”等应用启用通知设置 - How can we enable notification setting in android for app like “lock screen notification and badge icon” programatically 如何计算推送通知并在主屏幕应用程序图标上显示它们 - How to count the push Notifications and display them on the home screen app icon Android 在主屏幕上推送通知徽章计数器 - Android push notification badge counter on Home Screen 如何在Android电话簿中显示应用程序图标(如Whats App Skype) - how to show app icon in android phone book like whats app skype 最小化应用后,Android在主屏幕上显示视频,例如Skype - Android Show video on home screen like skype after minimizing app 从Android中的GCM创建新通知时,如何在自定义锁定屏幕上显示应用程序图标 - How to show app icon in custom lock screen when creating new notification from GCM in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM