Итак, я создал iOS Расширение службы уведомлений в формах Xamarin в соответствии с указанным здесь руководством [https://docs.microsoft.com/en-us/xamarin/ios/platform/user-notifications/enhanced-user-notifications?tabs=windows] [1]
Это мой код расширения, его точно так же, как в примере, описанном выше
[Register("NotificationService")]
public class NotificationService : UNNotificationServiceExtension
{
Action<UNNotificationContent> ContentHandler { get; set; }
UNMutableNotificationContent BestAttemptContent { get; set; }
protected NotificationService(IntPtr handle) : base(handle)
{
// Note: this .ctor should not contain any initialization logic.
}
public override void DidReceiveNotificationRequest(UNNotificationRequest request, Action<UNNotificationContent> contentHandler)
{
ContentHandler = contentHandler;
BestAttemptContent = (UNMutableNotificationContent)request.Content.MutableCopy();
// Modify the notification content here...
BestAttemptContent.Title = $"{BestAttemptContent.Title}[modified]";
ContentHandler(BestAttemptContent);
}
public override void TimeWillExpire()
{
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
ContentHandler(BestAttemptContent);
}
}
Но я не могу отладить полезную нагрузку уведомлений и не могу получить уведомление, происходит регистрация, поэтому я предполагаю, что моя конфигурация верно, но расширение службы не запускается
Если я что-то упустил, любые входные данные были бы полезны, к сожалению, я использую Azure Центр уведомлений для этого