I am building a prototyping using Azure Functions and Notification Hub.
Within my function I want a select a bunch of devices based on a geo spatial query and send a notification to these resulted devices.
I have notifications working with Firebase and Android but how can I target a random group of devices based on a query result?
#r "Microsoft.Azure.NotificationHubs"
#load "location.csx"
using System;
using System.Net;
using Microsoft.Azure.NotificationHubs;
public static async Task Run(LocationInfo message, IAsyncCollector<Notification> notification, TraceWriter log)
{
log.Info($"Sending GCM notification of a new user");
string gcmNotificationPayload = "{\"data\": {\"message\": \"test message")\" }}";
log.Info($"{gcmNotificationPayload}");
await notification.AddAsync(new GcmNotification(gcmNotificationPayload));
}