Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin.ios Azure通知中心注册因某些标记格式而失败_Xamarin.ios_Xamarin_Apple Push Notifications_Azure Notificationhub - Fatal编程技术网

Xamarin.ios Azure通知中心注册因某些标记格式而失败

Xamarin.ios Azure通知中心注册因某些标记格式而失败,xamarin.ios,xamarin,apple-push-notifications,azure-notificationhub,Xamarin.ios,Xamarin,Apple Push Notifications,Azure Notificationhub,我在iOS上对Azure通知中心使用Xamarin。一段时间以来,情况一直很好。但是,我最近在我注册设备的标签集合中添加了一个新标签 以下是有效的缩写代码: NSSet tags = new NSSet("Email-some@some.com"); if (tags != null) { Hub.RegisterNativeAsync(deviceToken, tags,(errorCallback) => { if (errorCallback != null)

我在iOS上对Azure通知中心使用Xamarin。一段时间以来,情况一直很好。但是,我最近在我注册设备的标签集合中添加了一个新标签

以下是有效的缩写代码:

NSSet tags = new NSSet("Email-some@some.com");
if (tags != null) {
    Hub.RegisterNativeAsync(deviceToken, tags,(errorCallback) => {
        if (errorCallback != null) {
            new UIAlertView("RegisterNativeAsync error", "Unable to register for Push notifications", null, "OK", null).Show();
            return;
        }
    });                 
}
但是,如果我用此内容替换第一行,RegisterNativeAsync将失败:

NSSet tags = new NSSet("Email-no email provided for some user");
我收到以下答复:

对{URL:}的URLRequest失败,状态代码为:请求错误

有关于标签的格式化规则吗?我有几十个其他标签,内容种类繁多,以前从未遇到过这个问题。

来自:

标记可以是任何字符串,最多120个字符,其中包含字母数字字符和以下非字母数字字符:''u'、'@'、''#'、'.'、':'、'-'


所以在你的例子中,空间打破了一切。

哇……我不知道我是如何轻松处理这些信息的。我想到目前为止我很幸运,我的标签中没有非法内容!