/// <summary> /// DEBUG-ONLY: Unregister any registrations with given deviceToken /// </summary> /// <param name="deviceToken">The device token</param> /// <returns>Task that completes when unregister is complete</returns> public Task UnregisterAllAsync(NSData deviceToken) { if (deviceToken == null) { throw new ArgumentNullException("deviceToken"); } return(this.RegistrationManager.DeleteRegistrationsForChannelAsync(ApnsRegistration.ParseDeviceToken(deviceToken))); }
/// <summary> /// DEBUG-ONLY: PLEASE USE NSData overload of this method!! Unregister any registrations with given deviceToken /// </summary> /// <param name="deviceToken">The device token</param> /// <returns>Task that completes when unregister is complete</returns> public Task UnregisterAllAsync(string deviceToken) { if (string.IsNullOrWhiteSpace(deviceToken)) { throw new ArgumentNullException("deviceToken"); } return(this.RegistrationManager.DeleteRegistrationsForChannelAsync(ApnsRegistration.TrimDeviceToken(deviceToken))); }
/// <summary> /// PLEASE USE NSData overload of this method!! Register a particular deviceToken /// </summary> /// <param name="deviceToken">The deviceToken to register</param> /// <param name="tags">The tags to register to receive notifications from</param> /// <returns>Task that completes when registration is complete</returns> public Task RegisterNativeAsync(string deviceToken, IEnumerable<string> tags) { if (string.IsNullOrWhiteSpace(deviceToken)) { throw new ArgumentNullException("deviceToken"); } var registration = new ApnsRegistration(deviceToken, tags); return this.RegistrationManager.RegisterAsync(registration); }
/// <summary> /// Register a particular deviceToken /// </summary> /// <param name="deviceToken">The deviceToken to register</param> /// <param name="tags">The tags to register to receive notifications from</param> /// <returns>Task that completes when registration is complete</returns> public Task RegisterNativeAsync(NSData deviceToken, IEnumerable <string> tags) { if (deviceToken == null) { throw new ArgumentNullException("deviceToken"); } var registration = new ApnsRegistration(deviceToken, tags); return(this.RegistrationManager.RegisterAsync(registration)); }
/// <summary> /// PLEASE USE NSData overload of this method!! Register a particular deviceToken /// </summary> /// <param name="deviceToken">The deviceToken to register</param> /// <param name="tags">The tags to register to receive notifications from</param> /// <returns>Task that completes when registration is complete</returns> public Task RegisterNativeAsync(string deviceToken, IEnumerable <string> tags) { if (string.IsNullOrWhiteSpace(deviceToken)) { throw new ArgumentNullException("deviceToken"); } var registration = new ApnsRegistration(deviceToken, tags); return(this.RegistrationManager.RegisterAsync(registration)); }
/// <summary> /// Register for notifications /// </summary> /// <param name="registration">The object defining the registration</param> /// <returns>Task that will complete when the registration is completed</returns> public Task RegisterAsync(Registration registration) { if (registration == null) { throw new ArgumentNullException("registration"); } if (string.IsNullOrWhiteSpace(registration.PushHandle)) { throw new ArgumentNullException("registration.PushHandle"); } registration.PushHandle = ApnsRegistration.TrimDeviceToken(registration.PushHandle); return(this.RegistrationManager.RegisterAsync(registration)); }
/// <summary> /// DEBUG-ONLY: List the registrations made with the service for a deviceToken /// </summary> /// <param name="deviceToken">The deviceToken to check for</param> /// <returns>List of registrations</returns> public Task <List <Registration> > ListRegistrationsAsync(NSData deviceToken) { return(this.RegistrationManager.ListRegistrationsAsync(ApnsRegistration.ParseDeviceToken(deviceToken))); }
/// <summary> /// DEBUG-ONLY: PLEASE USE NSData overload of this method!! List the registrations made with the service for a deviceToken /// </summary> /// <param name="deviceToken">The deviceToken to check for</param> /// <returns>List of registrations</returns> public Task <List <Registration> > ListRegistrationsAsync(string deviceToken) { return(this.RegistrationManager.ListRegistrationsAsync(ApnsRegistration.TrimDeviceToken(deviceToken))); }
/// <summary> /// Create a default Registration for a deviceToken with specific tags /// </summary> /// <param name="deviceToken">The device token</param> /// <param name="tags">The tags to register to receive notifications from</param> public ApnsRegistration(NSData deviceToken, IEnumerable <string> tags) : base(ApnsRegistration.ParseDeviceToken(deviceToken), tags) { }
/// <summary> /// Register a particular deviceToken /// </summary> /// <param name="deviceToken">The deviceToken to register</param> /// <param name="tags">The tags to register to receive notifications from</param> /// <returns>Task that completes when registration is complete</returns> public Task RegisterNativeAsync(NSData deviceToken, IEnumerable<string> tags) { if (deviceToken == null) { throw new ArgumentNullException("deviceToken"); } var registration = new ApnsRegistration(deviceToken, tags); return this.RegistrationManager.RegisterAsync(registration); }