/// <summary>
        /// Asynchronously unregisters the native registration on the application or secondary tiles.
        /// </summary>
        /// <param name="options"></param>
        public async void unregisterApplication(string options)
        {
            try
            {
                var args = JsonHelper.Deserialize <List <string> >(options);

                var notificationHubPath = args[0];
                var connectionString    = args[1];

                if (string.IsNullOrEmpty(notificationHubPath))
                {
                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "notificationHubPath can't be null or empty"));
                    return;
                }

                if (string.IsNullOrEmpty(connectionString))
                {
                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "connectionString can't be null or empty"));
                    return;
                }

                var hub = new Microsoft.WindowsAzure.Messaging.NotificationHub(notificationHubPath, connectionString);
                await hub.UnregisterNativeAsync();

                DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
            }
            catch (Exception ex)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ex.Message));
            }
        }
 public async void Unregister()
 {
     if (hub != null)
     {
         await hub.UnregisterNativeAsync();
     }
 }
        public async void UnregisterNativeAsync(string notificationHubPath, string connectionString)
        {
            var hub = new Microsoft.WindowsAzure.Messaging.NotificationHub(notificationHubPath, connectionString);

            await hub.UnregisterNativeAsync();
        }
        /// <summary>
        /// Asynchronously unregisters the native registration on the application or secondary tiles.
        /// </summary>
        /// <param name="options"></param>
        public async void unregisterApplication(string options)
        {
            try
            {
                var args = JsonHelper.Deserialize<List<string>>(options);

                var notificationHubPath = args[0];
                var connectionString = args[1];

                if (string.IsNullOrEmpty(notificationHubPath))
                {
                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "notificationHubPath can't be null or empty"));
                    return;
                }

                if (string.IsNullOrEmpty(connectionString))
                {
                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "connectionString can't be null or empty"));
                    return;
                }

                var hub = new Microsoft.WindowsAzure.Messaging.NotificationHub(notificationHubPath, connectionString);
                await hub.UnregisterNativeAsync();

                DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
            }
            catch (Exception ex)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ex.Message));
            }
        }
        public async void UnregisterNativeAsync(string notificationHubPath, string connectionString)
        {
            var hub = new Microsoft.WindowsAzure.Messaging.NotificationHub(notificationHubPath, connectionString);

            await hub.UnregisterNativeAsync();
        }