【发布时间】:2021-06-29 04:47:01
【问题描述】:
我正在尝试使用 azure 通知中心中的按钮发送推送通知。我刚刚为 iOS 找到了这个示例,
有没有办法将一个按钮添加到 Xamarin 表单的 azure 推送通知
【问题讨论】:
我正在尝试使用 azure 通知中心中的按钮发送推送通知。我刚刚为 iOS 找到了这个示例,
有没有办法将一个按钮添加到 Xamarin 表单的 azure 推送通知
【问题讨论】:
是的,有可能。
如何做到这一点的文档在这里:https://docs.microsoft.com/en-us/azure/developer/mobile-apps/notification-hubs-backend-service-xamarin-forms
编辑:
要获得取消按钮,您需要定义关闭操作:
var categoryID = "message";
var actions = new UNNotificationAction [] { action };
var intentIDs = new string [] { };
var categoryOptions = new UNNotificationCategoryOptions [] { };
var category = UNNotificationCategory.FromIdentifier (categoryID, actions, intentIDs, UNNotificationCategoryOptions.CustomDismissAction);
【讨论】: