我正在使用Azure通知中心向Android和iOS上的移动应用用户发送推送通知。
当我登录Azure门户并将测试消息发送到设备ID时,它可以正常工作。
我使用从Azure门户获取的策略名称为NotificationHubClient
的连接字符串创建DefaultFullSharedAccessSignature
。
NotificationHubClient.CreateClientFromConnectionString("Endpoint=sb://redacted.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=redacted", "redacted");
我目前正在尝试以最简单的方式发送通知:
Notification notification = new GcmNotification(message);
PushNotifications.Instance.Hub.SendNotificationAsync(notification, fakeUser.Devices).Wait();
我的AggregateException
内有Microsoft.Azure.NotificationHubs.Messaging.MessagingCommunicationException
。
我可以从内部异常中看到的相关细节:
Message
:无法连接到远程服务器
Inner Exception Message
:无法建立连接,因为目标计算机主动拒绝了它23.101.228.99:443 (似乎是Microsoft IP地址)
Detail.ErrorCode
:60000
Detail.ErrorLevel
:Microsoft.Azure.NotificationHubs.Messaging.MessagingExceptionDetail.ErrorLevelType.UserError
答案 0 :(得分:0)
这似乎是通过HTTP代理连接到Azure的问题。 我不能在另一台使用手机作为个人热点的机器上重现它。