调用PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); 时出现此异常;方法。它在Device上运行良好,但在 Local Machine 上失败。
这是我的代码:
private async void CreateChannel_Click(object sender, RoutedEventArgs e)
{
var vProfile = NetworkInformation.GetInternetConnectionProfile();
System.Diagnostics.Debug.WriteLine("InterNetConnectivity==>>" + vProfile.GetNetworkConnectivityLevel().ToString());
UserResponseTBL.Text = vProfile.GetNetworkConnectivityLevel().ToString();
if (vProfile.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess)
{
var vChannel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
string channelUri = vChannel.Uri;
UserResponseTBL.Text = channelUri;
System.Diagnostics.Debug.WriteLine("channelUri : " + channelUri);
}
}
我收到异常等待操作超时。(来自 HRESULT 的异常:0x80070102)。任何帮助都将不胜感激。谢谢