推送通知不会显示在状态栏上 [英] push notification doesn't show up on status bar

查看:82
本文介绍了推送通知不会显示在状态栏上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将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 = 'https://android.googleapis.com/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)

这篇关于推送通知不会显示在状态栏上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆