我实际上正在使用PushBots为我的应用程序实施GCM通知。
当我创建通知时,他们给我选项,使用特定字段,我可以为我的推送设置largeIcon
。如果我使用它,我得到这样的东西:
但是,如果我不使用它,我明白了:
我想知道是否可以为我的应用收到的每个通知(推送)设置默认smallIcon
和largeIcon
,或者更改为我自己的应用图标显示的白色框。
1-注意:我没有在我的代码中创建通知,我是在PushBots网站的Drashboard中创建的。
2-注意:largeIcon
和smallIcon
感谢。
答案 0 :(得分:1)
最后,在看了PushBots的源代码后,我发现了一个解决方案。
在Android Studio中,转到File -> New -> Image Asset
。然后,选择Notification Icon
。现在自定义新的小图标,在完成之前,为此新资产添加名称white_notification_icon
。
Android Studio会告诉您该文件已存在且将被覆盖。说是。
现在,默认情况下你已经设置了一个smallIcon!
答案 1 :(得分:0)
请参阅以下代码
<form name="myForm">
<input type="button" value="confirm" onclick="submitFunction()"/>
</form>
<script>
function submitFunction(){
document.getElementById("demo").innerHTML = "Hi How are you?";
}
</script>
<div id="demo"></div>
根据指南,小图标是强制性的,应为白色或灰色,带有背景refer this answer for more details