推送通知不会显示在状态栏上

编程入门 行业动态 更新时间:2024-10-25 02:26:41
本文介绍了推送通知不会显示在状态栏上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在将phonegap与phonegap-plugin-push一起使用,并且尝试了该插件随附的示例,当我在应用程序打开时发送通知时,我在我的手机(Galaxy s4,Android 5.0.1)上对其进行了测试我有振动,并且消息正在index.js中提到的div卡中显示,但是我没有在状态栏上收到通知,如果应用程序在后台,我也没有在状态栏上发出通知,但我得到了振动.我想知道为什么我在状态栏上没有通知弹出窗口.我使用phonegap-plugin-push 1.4.4

i'm using phonegap with phonegap-plugin-push , and i tried the example that comes with the plugin , i tested it on my phone ( Galaxy s4 , Android 5.0.1 ) , when i send notification while application is on i got vibration and the message is showing inside the cards div as mentioned in index.js but i got no notification on status bar , if the application is on background i got also no notification on status bar but i got vibration. i wonder why i have no notification popup on status bar. i use phonegap-plugin-push 1.4.4

推荐答案

@Del

我正在使用ruby发送通知

i am using ruby to send a notification

require 'rubygems' require 'pushmeup' GCM.host = 'android.googleapis/gcm/send' GCM.format = :json GCM.key = "key" destination = ["id"] data = {:title => "PhoneGap Push",:message => "PhoneGap Build rocks!", :msgcnt => "1", :soundname => "beep.wav"} options = {:collapse_key => "placar_score_global", :time_to_live => 3600, :delay_while_idle => false} GCM.send_notification( destination, data, options)

更多推荐

推送通知不会显示在状态栏上

本文发布于:2023-11-27 12:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1638011.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:栏上   状态   通知

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!