title: Firebase and push nofitications
body: <p>I've tried to let firebase manage all my data.
  Everything is working fine, but I need to send a push notification to my users when a new content is added.</p>
  
  <p>I was thinking about having a PHP server listening to any new firebase event, and sending a notification with a curl request.</p>
  
  <p>The problem is that curl doesn't seem to be able to send a request (to the notification server) while streaming (listening to firebase events).</p>
  
  <p>I've tried with <code>curl_multi_init</code>, but it doesn't seem to be working.</p>
  
  <p>So here is my question: how I am supposed to deal with notifications and firebase? Can PHP do it?</p>
  
  <p>Or have I to use another language ?</p>
  
  <p>Thanks for your help.</p>
  
  <p>UPDATE:</p>
  
  <p>For more information, I have added the code I try to use:</p>
  
  <pre><code>$master = curl_multi_init();
  
  
  $ch = curl_init();
  $curlToken = curl_init();
  
  
  curl_setopt($ch,CURLOPT_URL,'https://aweseome.firebaseio.com/plans.json?auth=XXXXXX');
  curl_setopt($ch, CURLOPT_NOBODY, 0);
  curl_setopt($ch, CURLOPT_HTTPHEADER,array('Accept: text/event-stream'));
  curl_setopt($ch, CURLOPT_USERAGENT, '');
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
  curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'callBackFunction');
  
  curl_multi_add_handle($master, $ch);
  curl_multi_add_handle($master, $curlToken);
  
  curl_multi_exec($master, $ch);
  </code></pre>
  
  <p>When using curl multi, the stream callback function is never called. If I use the normal curl, the stream function is called and is waiting for events, but I can no longer use another curl connexion to send the push notification.</p>
  
  <p>How would you proceed? What language would you use if not php?</p>