gpt4 book ai didi

c++ - C++ 应用程序中的 Azure 通知中心?

转载 作者:行者123 更新时间:2023-12-03 03:36:18 25 4
gpt4 key购买 nike

在 Microsoft 文档中,有 Azure 通知中心的 C# 实现示例 -- https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-windows-store-dotnet-get-started-wns-push-notification#create-a-sample-windows-app

private async void InitNotificationsAsync()
{
var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

var hub = new NotificationHub("<your hub name>", "<Your DefaultListenSharedAccessSignature connection string>");
var result = await hub.RegisterNativeAsync(channel.Uri);

// Displays the registration ID so you know it was successful
if (result.RegistrationId != null)
{
var dialog = new MessageDialog("Registration successful: " + result.RegistrationId);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
}

但是我们的应用程序使用 C++,我们在 WinRT/C++ 文档中找到了部分示例代码: https://learn.microsoft.com/en-us/uwp/api/windows.networking.pushnotifications.pushnotificationchannelmanager?view=winrt-22621

...但没有 Azure 代码的一部分:

var hub = new NotificationHub("<your hub name>", "<Your DefaultListenSharedAccessSignature connection string>");

这是否意味着对于具有裸 C++ Azure 消息传递的应用程序来说是不可能的主题?

最佳答案

目前,只有少数 Azure 服务可以使用 c++ SDK 来使用。您可以在这里查看:

https://azure.github.io/azure-sdk/cpp_introduction.html

但是,您可以直接与 REST Api 交互:

https://learn.microsoft.com/en-us/rest/api/notificationhubs/create-update-registration

关于c++ - C++ 应用程序中的 Azure 通知中心?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73238006/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com