Sending Notifications in to multiple users FCM
<p>I am configuring my mobile applications with firebase cloud messaging.
I've finally figured out how to send these annoying to configure notifications. 
My python code looks like this </p>

<pre><code>url = 'https://fcm.googleapis.com/fcm/send'
body = {  
"data":{  
   "title":"mytitle",
   "body":"mybody",
  "url":"myurl"
},
"notification":{  
  "title":"My web app name",
  "body":"message",
  "content_available": "true"
},
 "to":"device_id_here"
 }


headers = {"Content-Type":"application/json",
        "Authorization": "key=api_key_here"}
requests.post(url, data=json.dumps(body), headers=headers)
</code></pre>

<p>I would think that putting this in a for loop and swapping device ids to send thousands of notifications would be an immense strain on the server and a bad programming practice. (Correct me if i'm wrong)
now the documentation tells me to create "device groups" <a href="https://firebase.google.com/docs/cloud-messaging/notifications" rel="noreferrer">https://firebase.google.com/docs/cloud-messaging/notifications</a> which store device_id's to send in bulk....this is annoying and inefficient. As my groups for my web application are constantly changing. </p>

<p>Plain and Simple</p>

<p>How do I send the notification above to an array of device id's that I specify in my python code so that i can make only 1 post to FCM instead of thousands.</p>