These are chat archives for angular/angular-2-ionic-2

16th
Dec 2017
Rashid
@rashnk
Dec 16 2017 01:28
Hiii
Bienvenue TCHOUA
@tchoua08
Dec 16 2017 07:34
Hello
Hii
I'm trying to send and receive multiple images in my ionic 2 app to firebase but it's still the last image that is sent and displayed multiple times in the chat. here is the code
Bienvenue TCHOUA
@tchoua08
Dec 16 2017 07:40
lodash.each(timg, (item: string) => {
              item ="data:image/jpeg;base64,"+item;
              this.io.uploadImages(item).then( (data) => {
                this.ref.push({
                  username: this.username,
                  message: "",
                  datesms:new Date().toLocaleString(),
                  keylistforum:this.keyuser,
                  ville:this.location,
                  profilePicture:this.profilePicture,
                  email:this.email,
                  phone:this.phone,
                  images:data
                }).then(()=>this.io.urlImage=[])

              });


        });

uploadImages(captureDataUrl:string): Promise<any> {

return new Promise( (resolve, reject) => {


    const filename = Math.floor(Date.now() / 1000);

    const imageRef = this.storageRef.child(`images/${filename}.jpg`)


    imageRef.putString(captureDataUrl, firebase.storage.StringFormat.DATA_URL).then((snapshot)=> {

      imageRef.getDownloadURL().then(url =>{

        this.urlImage=[];
        this.urlImage.push(url);
        resolve(this.urlImage);
      });

    })

});

}

please can sommeone help me ?
Bienvenue TCHOUA
@tchoua08
Dec 16 2017 10:45
hello
Bienvenue TCHOUA
@tchoua08
Dec 16 2017 15:05
hello