您好,我正在使用 Web api 作为后端服务,其中使用 Azure 通知中心。我需要根据条件业务逻辑通知登录用户,简而言之就是针对特定用户。我从中提取代码this文章。一切正常但是标签不创建也不更新。我需要帮助。这是我的代码片段
// It returns registrationId
public async Task<OperationResult<string>> GetRegistrationIdAsync(string handle)
{
........
}
// actual device registration and tag update
public async Task<OperationResult<RegistrationOutput>> RegisterDeviceAsync(string userName, string registrationId, Platforms platform, string handle)
{
...........
registration.Tags.Add(string.Format("username : {0}", userName)); // THIS TAG IS NOT CREATING
await _hub.CreateOrUpdateRegistrationAsync(registration);
...........
}
// Send notification - target specific user
public async Task<OperationResult<bool>> Send(Platforms platform, string userName, INotificationMessage message)
{
...........
}
提交这个问题后,我尝试从 VS 通知资源管理器更新标签。在那里我发现标签不允许有空格我的 api 调用中的标签格式有空格。这些空间是罪魁祸首。 API调用默默地忽略这些无效的标签格式
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)