をネイティブの通知を使用している場合は、ここにあなたがそれを行う方法です。
AppleTemplateRegistrationDescription registration = new AppleTemplateRegistrationDescription(parameters.registrationID)
{ BodyTemplate = new CDataMember("{\"aps\":{\"alert\":\"$(body)\",\"payload\":\"$(payload)\",\"deeplinking\":\"$(deeplinking)\",\"category\":\"$(category)\",\"image\":\"$(image)\"}}"),
Tags = itags,
Expiry = "$(APNS_Expiry)"
};
送信の一部として、有効期限の値を渡すことができます。
var notification = new TemplateNotification(new Dictionary<string, string>()
{
{"APNS_Expiry", DateTime.UtcNow.AddMinutes(10).ToString("o") }, //Timestamp
{"body", NotificationText},
{"payload", NotificationText},
{"deeplinking", payload},
});
var Responsehub = hub.SendNotificationAsync(notification);
あなたはネイティブの通知を使用している場合は、
// Native notification
var notification = new AppleNotification(@"
{
""aps"": {
""alert"":""New notification!""
}
}");
notification.Expiry = DateTime.UtcNow.AddMinutes(2);
await notificationHubClient.SendNotificationAsync(notification);
はい!それが問題です。どうもありがとう。私はAzureドキュメントを改善すべきだと思う...なぜ彼らはスタートガイドのドキュメントにそれを含めていないのですか?もちろん、プッシュしておきたい場合はもう一度やり直したいと思っています。誰がそれを望んでいないのですか? – Ivan