social share share multiple urls and base 64 data in ionic4

 share(data) { 

    console.log(data);

    for (var i = 0; i < data.Connected_apps.length; i++) {

      console.log(i);

      this.urldata.push(data.Connected_apps[i].ExternalLink);     

    }

    console.log(this.urldata.length, data.Connected_apps.length);

    if (this.urldata.length == data.Connected_apps.length) {

      console.log(this.urldata.length, data.Connected_apps.length);

      let arr = this.urldata;

    this.newarr = []

    for(let i=0;i<arr.length;i++){

      if(this.newarr.length>0){

          let newarr1 = this.newarr;

          this.newarr = [];

          this.newarr.push(newarr1[0]+'\n'+'OR'+'\n'+arr[i]);

      }else{

        this.newarr = []

        this.newarr.push(arr[i]);

      }

    }

    console.log(this.newarr.toString(),"newarray")

    this.screenshot.URI(80).then(res => {

      this.screen = res.URI;

      console.log(this.screen, " this.screen");

      this.socialSharing.share('','',this.screen,this.newarr.toString()).then(() => {

      }).catch(() => {

});

}).catch((err:any) => {

       alert("error" + err);

     });

    }

    }

Comments

Popular posts from this blog

how to split array as per fixed length, and ionic two dates differences in min,seconds,hours

How to Add Firebase Analytics to Your NativeScript Mobile App