Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Notification Hub GetAllRegistrationsAsync only returning 100 items

$
0
0

I am using the Azure Servicebus - Notification Hub to send messages to apple devices.

I also want to be able to get a list of active devices and view some of the properties. I use the GetAllRegistrationsAsync(int32) call to get a list of users but I am only ever being returned 100 results where I can see from the Azure control panel that there are well over 100 active devices.

The code I am using is: 

static void Main(string[] args)
        {
            SendNotificationAsync();
            Console.ReadLine();
        }

        private static async void SendNotificationAsync()
        {
            NotificationHubClient hub = NotificationHubClient.CreateClientFromConnectionString("Endpoint=sb://nwappnotificationhub-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","nwappnotificationhub");
            var allusers = await hub.GetAllRegistrationsAsync(Int32.MaxValue);
            Console.WriteLine(allusers.Count());

            for (int i = 0; i < 10; i++)
            {
                var q = from x in allusers
                        where x.Tags.Count == i
                        select x;
                Console.WriteLine("users with " + i + "tage: " + q.Count());

            }
        }

From all the documentation and examples I have seen this should return a full list of devices.. however it is always 100

I have tried reducing the number I select to 50 and then I get 50 results back. 

Below is the summary I can see from azure showing I have more than 100 active devices..


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>