Exemplo n.º 1
0
        /// <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)));
        }
Exemplo n.º 2
0
        /// <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)));
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        /// <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));
        }
Exemplo n.º 5
0
        /// <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));
        }
Exemplo n.º 6
0
        /// <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));
        }
Exemplo n.º 7
0
 /// <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)));
 }
Exemplo n.º 8
0
 /// <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)));
 }
Exemplo n.º 9
0
 /// <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)
 {
 }
Exemplo n.º 10
0
        /// <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);
        }