0

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 データが表示されますが、「通知の送信がタイムアウトしました」という理由で通知失敗エラーが表示されます。

何が欠けているのか誰でも教えてくれますか?

4

1 に答える 1

-1

なしで実行してみてWithDryRun()ください。NotificationSentChannelExceptionNotificationFailedServiceException

于 2014-10-08T16:48:49.113 に答える