Xamarin.ios Azure通知中心注册因某些标记格式而失败
我在iOS上对Azure通知中心使用Xamarin。一段时间以来,情况一直很好。但是,我最近在我注册设备的标签集合中添加了一个新标签 以下是有效的缩写代码: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)
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'、'@'、''#'、'.'、':'、'-'
所以在你的例子中,空间打破了一切。哇……我不知道我是如何轻松处理这些信息的。我想到目前为止我很幸运,我的标签中没有非法内容!