🌷🌷🌷🌷① 推送通知示例
🌷🌷🌷🌷② 后台任务示例
🌷🌷🌷🌷③ 后台任务调度示例
🌷🌷🌷🌷④ 后台任务队列示例
① 推送通知示例:
using System;
using System.Threading.Tasks;
using Microsoft.Azure.NotificationHubs;
public class PushNotificationExample
{
private NotificationHubClient hubClient;
public PushNotificationExample(string connectionString, string hubName)
{
hubClient = NotificationHubClient.CreateClientFromConnectionString(connectionString, hubName);
}
public async Task SendPushNotificationAsync(string message, string tag)
{
var notification = new Notification(message);
await hubClient.SendNotificationAsync(notification, tag);
}
}
这个例子演示了如何使用Azure Notification Hubs发送推送通知。代码中创建了一个