0

Push Sharpは初めてです。Push Sharp を使用して Android デバイスにメッセージを送信しようとしています。うまく機能しますが、問題は Push Sharp が同じメッセージを何度も送信していることです。

私のコードは次のとおりです。

AndroidPushBroker = new PushBroker();

var googleKey = CustomConfigurationManager.GetValueFromSection("appSettings", "GoogleServerAccessKey");
            AndroidPushBroker.RegisterGcmService(new PushSharp.Android.GcmPushChannelSettings(googleKey));

            var jsonMessage = "{\"InformationId\":\"" + notification.Message + "\",\"badge\":7,\"sound\":\"sound.caf\",\"NotificationType\":\"" + notification.Type.ToString() + "\"}";

            GcmNotification androidNotifcation = new GcmNotification().ForDeviceRegistrationId(notification.DeviceId)
                .WithJson(jsonMessage);
            AndroidPushBroker.QueueNotification(androidNotifcation);

問題: メッセージ「メッセージ 1」を送信し、その後「メッセージ 2」を送信すると、「メッセージ 1」が再度送信されます。Queue からアイテムを削除する必要がありますか? または、何が欠けていますか。?

: アプリケーションに Push Broker のインスタンスが 1 つあります。

4

2 に答える 2