Setting up the iOS notification service extension in Xamarin
Step-by-step
1. Setup the iOS notification service extension
- Right click on the project in the navigator on the left, then select Add -> Add New Project.
- Select iOS -> Extension -> Notification Service Extension.
- Right click on new Project's References then select Edit References.
- Add AcousticMobilePush.iOS.Notification.dll to project.
- Add MceConfig.json from the iOS project to the iOS Notification project.
- Replace the NotificationService.cs file with the following contents:
using System;
using Foundation;
using UserNotifications;
using AcousticMobilePush.iOS.Notification;
namespace Sample.iOS.Notification
{
[Register("NotificationService")]
public class NotificationService : MCENotificationService
{
public override void DidReceiveNotificationRequest(UNNotificationRequest request, Action<UNNotificationContent> contentHandler)
{
base.DidReceiveNotificationRequest(request, contentHandler);
}
}
}
Updated about 1 year ago