14

The documentation says about NotificationHubClient.GetRegistrationsByTagAsync(string tag, int top) in Azure Push Notifications as below,

top (Int32) : The location where to get the registrations.

But I have no idea what top or location stands for.
An example I found use just 100 but no reason to use it.

Youngjae
  • 24,352
  • 18
  • 113
  • 198

1 Answers1

18

Basically it means get at most top records.

So if you have 1000 registrations with tag 'A' then NotificationHubClient.GetRegistrationsByTagAsync("A", 42) will return 42 records.

However, top cannot be more then 100! NotificationHubClient.GetRegistrationsByTagAsync("A", 142) will only return 100 records.

efimovandr
  • 1,594
  • 9
  • 11
  • 4
    Thanks for the reply. it may need to be documented. – Youngjae Sep 08 '14 at 22:29
  • anyway, then, why it does not have *skip* to navigate them? does it have FIFO or LIFO manner? – Youngjae Sep 08 '14 at 22:38
  • Notice that records are returned as CollectionQueryResult which has ContinuationToken propery. Also there is overload of GetRegistrationsByTagAsync method which takes continuation token as parameter. So you can scan registrations page by page. Could you explain what your scenario is? I am just trying to figure out why it is required to read **many** registrations by tag. – efimovandr Sep 09 '14 at 02:01