You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Notification Hubs无法注册Android和iOS设备问题求助

Azure Notification Hubs无法注册Android和iOS设备问题求助

大家好,我这边遇到个头疼的问题,想请各位大佬帮忙分析下:

我们有个稳跑了快一年的.NET 4.8服务端应用,负责处理Android和iOS客户端的APN、FCMv1设备注册,一直都是用Azure Notification Hubs的NuGet包来实现的——客户端先构造好DeviceInstallation数据,再传给服务端执行注册逻辑。

但最近几天突然掉链子了:新设备注册不了,现有设备的安装记录也更新失败。之前一直正常运行的核心注册逻辑代码如下:

public async Task<bool> CreateOrUpdateInstallationAsync(DeviceInstallation deviceInstallation)
{
    // Error handling
    Installation installation = new Installation
    {
        InstallationId = deviceInstallation.InstallationId,
        PushChannel = deviceInstallation.PushChannel,
        Tags = deviceInstallation.Tags,
        ExpirationTime = DateTime.Now.AddDays(registrationTimeToLiveInDays)
    };

    if (installationPlatforms.TryGetValue(deviceInstallation.Platform, out NotificationPlatform platform))
    {
        installation.Platform = platform;
    }
    else
    {
        // Error handling
    }

    try
    {
        await hub.CreateOrUpdateInstallationAsync(installation);
        return await DoesInstallationExistsAsync(installation.InstallationId);
    }
    catch (Exception e)
    {
        // Error handling
        return false;
    }
}

为了排查问题,我们做了这些尝试:

  • 绕过NuGet包,直接调用Notification Hubs的REST API注册,结果还是一样失败
  • 在Azure门户用测试Hub测试,监控面板能看到注册请求确实已经到达Azure,但Hub的设备注册摘要里就是看不到任何已注册的设备

现在有点摸不着头脑:是我们的代码哪里有疏漏没发现?还是西欧区域的Azure Notification Hubs服务出故障了?

另外说明下,我已经在Microsoft Learn上也提了这个问题,避免重复踩坑。

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.07 10:59:38