到目前为止,我想创建用于推送通知的模板,但我一直停留在这里,并且无法正常工作。
public static async void SendPushNotificationApns1(string msgTemplate)
{
NotificationHubClient hub = NotificationHubClient.CreateClientFromConnectionString(ListenConnectionString, NotificationHubName);
string msg = "{\"aps\":{\"alert\":\"$(msgTemplate)\"}}";
await hub.SendAppleNativeNotificationAsync(msg);
}
答案 0 :(得分:0)
它发生在:string msg = "{\"aps\":{\"alert\":\"" + $"{messageParam}" +"\"}}";