【问题标题】:azure push notification send with a button使用按钮发送天蓝色推送通知
【发布时间】:2021-06-29 04:47:01
【问题描述】:

我正在尝试使用 azure 通知中心中的按钮发送推送通知。我刚刚为 iOS 找到了这个示例,

https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-aspnet-backend-ios-apple-push-notification-service-apns-rich

有没有办法将一个按钮添加到 Xamarin 表单的 azure 推送通知

【问题讨论】:

    标签: azure xamarin


    【解决方案1】:

    是的,有可能。

    如何做到这一点的文档在这里: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);
    

    见:https://docs.microsoft.com/en-us/xamarin/ios/platform/user-notifications/enhanced-user-notifications?tabs=windows

    【讨论】:

    • 谢谢,但我已经这样做了。我需要发送一个带有推送通知的按钮。例如:如果我发送了一个应用更新消息推送通知应该是更新按钮和取消按钮。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多