我正在尝试使用 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”的 json 数据:true,但我仍然收到通知失败错误,原因是:“通知发送超时”。
谁能告诉我我错过了什么?