0

I'm displaying images in my app hosted with s3/cloudfront. All is fine when testing, Android emulator, device and on the web server but after google approved my app and I download it from the play store all the images are broken? The links are all https, maybe that might cause an issue? Text is coming back from the api fine, it's just the image links.

Anyone run into this problem?

html page:

<ion-content padding>
  <ion-card *ngFor="let article of articles" (click)="getPage(article.id, article.company)" tappable role="button">

  <div class="main-image">
    <div class="image-crop" [ngStyle]="{background: 'url(' + article.mainImage + ') no-repeat center center'}"></div>
  </div>

  <ion-item>
    <h2>{{article.mainHeading}}</h2>
  </ion-item>

  <ion-card-content>
     {{article.mainBody | truncate : 86}}
   </ion-card-content>

  </ion-card>

  <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
    <ion-infinite-scroll-content></ion-infinite-scroll-content>
  </ion-infinite-scroll>

  <ion-refresher (ionRefresh)="doRefresh($event)">
    <ion-refresher-content></ion-refresher-content>
  </ion-refresher>

</ion-content>

component

loadArticles() {
this.httpService.getData('articles?limit=' + this.limit + '&skip=' + this.currentPage * 10)
  .subscribe(
    (data: any) => {
      this.articles = data;
    },
    (error) => {
      console.log(error);
    }
  );

}

Keith
  • 1,839
  • 4
  • 15
  • 26
  • did you made sure you have `cordova-plugin-whitelist` installed ? – Prashant G Mar 13 '17 at 00:58
  • Thanks for the reply. Yes I do have that installed. – Keith Mar 13 '17 at 01:17
  • 1
    Makes me think its the problem with the cloudfront configuration. Check this question ? http://stackoverflow.com/questions/17533888/s3-access-control-allow-origin-header – Prashant G Mar 13 '17 at 01:21
  • Okay weird, they just started working now. I did turn on and off "Create OAI" under CloudFront Origin Access Identity Getting Started. But I didn't check the image until after I did that, maybe a coincidence. – Keith Mar 13 '17 at 01:53
  • Great, whatever works, works man! – Prashant G Mar 13 '17 at 01:54

0 Answers0