How to show an external image in an iOS app using Cordova

I am attempting to display an image from an external location (AWS S3) in an iOS emulator using Ionic/Cordova/Angular. Here is the code snippet I am trying to work with:

<img src="https://miyagi-photos.s3.amazonaws.com/madeline-profile"/>


Here are some of the methods I have tried:

1) Added AmazonAWS to Cordova's whitelist, although I believe it is already covered by the existing access origin line:

<access origin="*"/> <!-- existing -->
<access origin="*.amazonaws.*" />  <!-- added this -->

2) Attempted to remove the protocol altogether like this:

<img src="miyagi-photos.s3.amazonaws.com/madeline-profile"/>

3) Tried using a different image with a standard http protocol:

<img src="http://upload.wikimedia.org/wikipedia/en/b/b1/Portrait_placeholder.png"/>

4) Experimented with using ng-src instead of src:

<img ng-src="https://miyagi-photos.s3.amazonaws.com/madeline-profile"/>


For full reference, here is the entire page layout:

<ion-view class="has-header" view-title="Create Class">
  <ion-content>
    <form>
      <div>
        <label for="ClassName">Class Name: </label>
        <input type="text" name="name" ng-model="classInformation.name" required>
      </div>

      <div>
        <label for="ClassPhoto">Class Photo: </label>
        <div class="button" ng-file-select ng-file-change="upload($files)" ng-multiple="multiple">Select File</div>
        <img src="https://miyagi-photos.s3.amazonaws.com/madeline-profile" height="150px"/>
      </div>

      <div>
        <label for="description">description: </label>
        <input type="text" name="description" ng-model="classInformation.description" required>
      </div>

      <div>
        <label for="rate">rate: </label>
        <input type="text" name="rate" ng-model="classInformation.rate" required>
      </div>

      <div>
        <label for="date">date: </label>
        <input type="text" name="date" ng-click="setDate()" ng-model="classInformation.date" required>
      </div>

      <div>
        <label for="time">time: </label>
        <input type="text" name="time" ng-click="setTime()" ng-model="classInformation.time" required>
      </div>

      <div>
        <label for="location">location: </label>
        <input type="text" name="location" ng-model="classInformation.location" required>
      </div>

      <button type="submit" value="Submit" ng-click="createClass()">Create Class</button>
    </form>
  </ion-content>
</ion-view>

Answer №1

Restarting Xcode solved the issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Javascript conditional testing

I need help coding a <div> to display only if the numeric input is 18 or above and the YO option is chosen. Any guidance on this would be highly appreciated. See the code snippet below. <input type=numeric id=ageSelf ng-model="ageSelf" style="c ...

Is there a way to prevent the automatic triggering of the delete UITableViewRowAction when swiping a tableview cell to the left edge of the phone?

Is there a way to prevent the automatic triggering of the delete UITableViewRowAction when swiping a tableview cell to the left edge of the phone? https://i.sstatic.net/fqspI.png ...

Tips for organizing information within a table

I have been developing a tool that allows users to enter a username, and then I display the data fetched from GitHub related to that particular user. Although each cell in the table is sortable, they all seem to sort data based on the first cell. When I cl ...

Take two inputs, divide them, and then multiply the result by 100

I am currently troubleshooting the total project match function, as it is not working properly. I aim to have this function divide the first function by the second function and then multiply the result by 100. Here is a snippet of my code: matchContribu ...

Obtaining the complete JSON array in string format

I am currently using Fine Uploader to pass parameters in this way callbacks: { onSubmit: function(id, fileName) { this.setParams({ a: 'adm', b: '126', c: { fileID: id, ...

Trouble with translating code from JavaScript to Python due to hash algorithm discrepancy

In an attempt to achieve consistent hash function results between JavaScript and Python, I encountered a roadblock when trying to convert my JavaScript function to its Python equivalent, resulting in unexpected outcomes. Original JavaScript Function: func ...

List output with jQuery AJAX showing object data

Here is my code that utilizes ajax for searching: $("#keyword").keyup(function() { var keyword = $("#keyword").val(); if (keyword.length >= MIN_LENGTH) { $.get( "./lib/data_siswa_ajax.php", { keyword: keyword, sekolah: $("#sekolah").val ...

Tips for incorporating 'and' in the 'on' clause of 'join' in knex.js

I need assistance implementing the following SQL code in knex.js: select c.id,c.parent_id,c.comment,u.username,c.postid from comments as c join post_details as p on (p.id = c.postid and c.postid=15)join users as u on (u.id = c.userid); I attempt ...

Find the vertices located on the "upper surfaces" of the ring using Three.js

I'm currently immersed in a project centered around creating different types of "rings" using Three.js. Each ring is formed through an algorithm I designed myself, which involves defining 4 sections placed at π, π/2, 3π/2, and 2π, then utilizing q ...

Having trouble finding the element during Selenium JavaScript testing

I need help testing a JavaScript script using Selenium, but I am running into an issue. I cannot seem to find a specific element that I want to click on. Here is a snippet of my JS code where I am trying to click on the Shipping option. I have tried us ...

Employing VUE.js for content retrieval

Is there an issue rendering 2 messages in vue.js on the front end? <template v-for="item in items"> <span>{{ afterpayMessage }}: {{ item.price }} with AfterPay</span> </template> <script> var afterpay = new Vue({ e ...

Is there a specific reason why passing functions from Express.js to EJS is not as straightforward as passing other variables?

I have been developing a blogging application using Express, EJS, and MongoDB. While working on implementing pagination for the posts, I encountered an issue with passing newerPosts and olderPosts to the view. I am passing them in a similar way to how the ...

How is it possible for me to retrieve data values directly from a sequelize model?

My question is straightforward - when doing a single select in sequelize, a model is returned. Inspecting this model reveals various options such as dataValues, _prevValues, _change, _options, isNewRecord, and more. What puzzles me is that you can also a ...

React Native Fetch encountering the error message 'Unable to complete network request'

Having an issue with posting data from a React Native app using `react-native-image-crop-picker` to upload images. The request is failing with a "Network request failed" error, although it works fine with Postman. The backend is not receiving the request a ...

Attempting to understand the concept of "this" in my JavaScript code. One aspect is functioning correctly while the other is not

Currently, I am improving my knowledge of JavaScript by reworking certain jQuery examples from a reference book. In this particular snippet of code, I am implementing a click listener for a tab to change to an active state once the user clicks on it. va ...

In Angular, attempting to access and review a file prior to sending it to a server for processing

My ng-drop area allows users to upload STL formatted files to the server. I am attempting to open and generate thumbnails using the three.js library before sending these files to the server. First, I create a 'local' copy by having FileReader re ...

Utilizing PHP Variables in an External JavaScript: A Step-by-Step Guide

I am attempting to utilize an array generated in PHP within my external JavaScript. My PHP code retrieves images from a directory based on the user ID provided via URL and stores them in an array. I aim to use this array in JavaScript to create a photo sli ...

Using jQuery to dynamically insert a table row with JSON data into dropdown menus

I'm working on a web form that includes a table where users can add rows. The first row of the table has dependent dropdowns populated with JSON data from an external file. Check out the code snippet below: // Function to add a new row $(function(){ ...

Where can a second TextLabel be positioned within a UITableViewCell on an iOS device?

Is it possible to add additional text on the right side of a UITableViewCell in an iOS app, similar to the example shown below? Any suggestions on how this can be achieved? Thank you in advance for your assistance. ...

Dealing with redirect issues in a React-Material menu: A guide to troubleshooting and

When working with my menu, I face a variety of issues. First and foremost, within the initial RETURN section, there is a TREEITEM with a LISTITEM and a LISTITETEXT. I have included an OnClick event in the LISTITETEXT so that if the menu's id matches ...