/// <summary> /// Initializes a new instance of the PushNotificationRegistry class. /// </summary> /// <param name="notificationServerRegistration">Handlers registering push notification tokens with a remote server.</param> /// <param name="systemInformation">An object that provides information about the current system.</param> protected PushNotificationRegistry(IPushNotificationServerRegistration notificationServerRegistration, ISystemInformation systemInformation) { Throw.IfArgumentNull(notificationServerRegistration, nameof(notificationServerRegistration)); Throw.IfArgumentNull(systemInformation, nameof(systemInformation)); this.notificationServerRegistration = notificationServerRegistration; this.systemInformation = systemInformation; }
/// <summary> /// Creates a push notification registry for the current application. /// </summary> /// <param name="notificationServerRegistration">An object responsible for registering the current device to receive push notifications from a remote server.</param> protected override PushNotificationRegistry CreatePushNotificationRegistry(IPushNotificationServerRegistration notificationServerRegistration) { return(new iOSPushNotificationRegistry(notificationServerRegistration, this.SystemInformation)); }
/// <summary> /// Creates a push notification registry for the current application. /// </summary> /// <param name="notificationServerRegistration">An object responsible for registering the current device to receive push notifications from a remote server.</param> protected abstract PushNotificationRegistry CreatePushNotificationRegistry(IPushNotificationServerRegistration notificationServerRegistration);
/// <summary> /// Enables support for push notifications in the current application. /// </summary> /// <param name="knownNotificationTypes">A collection of expected notifications that will be received by the application.</param> /// <param name="notificationServerRegistration">An object responsible for registering the current device to receive push notifications from a remote server.</param> public void EnablePushNotifications(PushNotificationTypes knownNotificationTypes, IPushNotificationServerRegistration notificationServerRegistration) { if (this.pushNotificationRegistry == null) { this.knownNotificationTypes = knownNotificationTypes; this.pushNotificationRegistry = this.CreatePushNotificationRegistry(notificationServerRegistration); } }
/// <summary> /// Initializes a new instance of the iOSPushNotificationRegistry class. /// </summary> /// <param name="notificationServerRegistration">Handlers registering push notification tokens with a remote server.</param> /// <param name="systemInformation">An object that provides information about the current system.</param> public iOSPushNotificationRegistry(IPushNotificationServerRegistration notificationServerRegistration, ISystemInformation systemInformation) : base(notificationServerRegistration, systemInformation) { }