AlexDemo
AlexDemo

Reputation: 171

azure push notification send with a button

I am trying to send a push notification with a button in azure notification hub. I just found this example for iOS,

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

Is there a way to add a button to azure push notifications to Xamarin forms

Upvotes: 0

Views: 309

Answers (1)

Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65481

Yes, it is possible.

The documentation of how to do this is here: https://learn.microsoft.com/en-us/azure/developer/mobile-apps/notification-hubs-backend-service-xamarin-forms

Edit:

To get a cancel button you need to define a dismiss action:

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);

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

Upvotes: 0

Related Questions