title: Retrieving an array of photos from firebase storage
body: <p>while i'm working in more than 3 applications using ionic 
  every time i face the same issue that is retrieving data from firebase storage </p>
  
  <p>like photos for example </p>
  
  <p>get the downloadURL for one photo works good to be honest but when it comes to get the downloadURL for a lot of photos and make it automatically using *ngFor</p>
  
  <p>its the hardest thing in the world</p>
  
  <p>if you have anything to to this job please help me ill appreciate it</p>
  
  <p>i write this code to do the job</p>
  
  <pre><code>export class AdmPage{
  
  
    public downloadedUrls: [];
  
  
    constructor() {  
  
      const file = `image/jpg`
      var storageRef = firebase.storage().ref();
  
    var  uploadTask = storageRef.child('images/rivers.jpg').put(file);
  
  
      uploadTask.on('state_changed', function(snapshot){
        // Observe state change events such as progress, pause, and resume
        // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded
        var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
        console.log('Upload is ' + progress + '% done');
        switch (snapshot.state) {
          case firebase.storage.TaskState.PAUSED: // or 'paused'
            console.log('Upload is paused');
            break;
          case firebase.storage.TaskState.RUNNING: // or 'running'
            console.log('Upload is running');
            break;
        }
      }, function(error) {
        // Handle unsuccessful uploads
      }, function() {
        // Handle successful uploads on complete
        // For instance, get the download URL: https://firebasestorage.googleapis.com/...
        this.downloadedUrls.push(uploadTask.snapshot.downloadURL);
  
        });
  
      }
      }
  </code></pre>
  
  <p>and this to show in html</p>
  
  <pre><code> &lt;ion-col *ngFor="let photo of downloadedUrls"&gt;
          &lt;img src="{{ photo }}"&gt;
       &lt;/ion-col&gt;
  </code></pre>
  
  <p>but it doesn't work 
  nothing of the photos that i had uploaded in the firebase storage shown </p>
  
  <p>in the chrome console it say this </p>
  
  <pre><code>ERROR Error: Uncaught (in promise): [DEFAULT]: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
  [DEFAULT]: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
      at app (index.cjs.js:307)
      at Object.serviceNamespace [as storage] (index.cjs.js:366)
      at new AdmPage (adm.page.ts:22)
      at createClass (core.js:22148)
      at createDirectiveInstance (core.js:22029)
      at createViewNodes (core.js:23255)
      at createRootView (core.js:23169)
      at callWithDebugContext (core.js:24177)
      at Object.debugCreateRootView [as createRootView] (core.js:23687...
  </code></pre>