0
/*Get the URI that the Microsoft Push Notification Service returns to the Push Client when creating a notification channel.
Normally, a web service would listen for URIs coming from the web client and maintain a list of URIs to send                
notifications out to. */

string subscriptionUri = TextBoxUri.Text.ToString();

pushclient が URI を Web サービスとどのように同期するかについての詳細は、MSDNの説明にはありません。では、Windows Phone のプッシュ通知クライアントを使用してアプリの URI を MPNS に送信する方法を知っている人はいますか?手動でコピーして Web アプリケーションに貼り付ける必要がありますか? グリーツGP

4

2 に答える 2

1

次のMSDNWindowsPhoneコードサンプルを参照してください:http: //msdn.microsoft.com/en-us/library/ff431744 (v = vs.92).aspx

'sdkToastNotificationCS'の例の次のコードスニペットは、URIを保存したりWebサービスに送信したりできる場所を示しています。

void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
    {

        Dispatcher.BeginInvoke(() =>
        {
            // Display the new URI for testing purposes.   Normally, the URI would be passed back to your web service at this point.
            System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
            MessageBox.Show(String.Format("Channel Uri is {0}",
                e.ChannelUri.ToString()));
            // Instead of showing the URI in a message box, POST to your web service

        });
    }

HTTP POSTリクエストを実行して、プッシュユーザーのURIと識別子を送信します。WebサービスでこのPOSTデータを受信し、ユーザー/ URIを保存して、Webサービスからそのユーザーに通知をプッシュできるようにします。

于 2012-02-28T18:21:18.243 に答える
0

アプリが PNS uri (およびその他の関連情報) を送信できるサーバー上のエンドポイントだけが必要です。

于 2012-02-02T01:34:34.503 に答える