Exemplo n.º 1
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.º 2
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.º 3
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)));
 }