在应用关闭时收到通知,在应用未运行时不显示通知

时间:2017-03-26 19:04:05

标签: android firebase push-notification

我使用 firebase 并在应用运行正常时从服务器获取通知,但在关闭时无法显示。

我是怎么做到的?我对此一无所知

如何开始学习它,或者我从这个code.i中找到示例,使用firebase中的所有内容。

例如......

  

编译' com.google.firebase:firebase-messaging:9.6.0'

     

应用插件:' com.google.gms.google-services'

只想为此操作编写代码。

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

当应用程序位于前台时,您可以使用firebase面板进行通知。但是当它在后台或被杀时,你无法通过firebase面板获得通知。你必须使用服务器基础代码,如php脚本。你可以从堆栈中得到答案,因为之前会问这个问题。

相关问题