我正在尝试使用PushSharp通过Google Gcm向我的移动设备发送通知。我从github下载了样例应用程序,这取决于我已经编写了样例代码。下面是我的示例代码。
var googleKey = CustomConfigurationManager.GetValueFromSection("appSettings", "GoogleServerAccessKey");
AndroidPushBroker.RegisterGcmService(new PushSharp.Android.GcmPushChannelSettings(googleKey));
GcmNotification androidNotifcation = new GcmNotification().WithDryRun()
.WithJson("{\"alert\":\"Hello World!\",\"badge\":7,\"sound\":\"sound.caf\"}");
AndroidPushBroker.QueueNotification(androidNotifcation);问题是,虽然我使用了WithDryRun(),在连接请求时,它显示了带有"dry_run":true的json数据,但我仍然收到通知失败的错误,原因是:“通知发送超时”。
有人能告诉我我错过了什么吗?
发布于 2014-10-09 00:48:49
试着在没有WithDryRun()的情况下运行它,看看do you get and in events如NotificationSent,ChannelException,NotificationFailed或ServiceException。
https://stackoverflow.com/questions/24943600
复制相似问题