Saturday, August 11, 2018

Ionic 4 + Capacitor Calling Local API Blocked Mixed Content Error

Problem:
Ionic 4 + Capacitor app running locally on device. NodeJS + Express + MongoDB API running local on http (not https).

Can hit local API successfully when running Ionic in browser on API url localhost or IPv4 address (e.g. 192.168.15.8).

When running on device (connected via USB) get the following error on all API calls (in Chrome developer tools network tab): (blocked-mixed-content)

Solution:
Add: "allowMixedContent": true
To: \capacitor.config.json
https://github.com/ionic-team/capacitor/issues/630

4 comments:

  1. Certsout.com provides authentic IT Certification exams preparation material guaranteed to make you pass in the first attempt, this is the right platform where you can get exact C_ARSCC_19Q1 Dumps.

    ReplyDelete
  2. I will share it with my other friends as the information is really very useful. Keep sharing your excellent work. Read more info about Certification Exam Dumps

    ReplyDelete
  3. Nice info, I am very thankful to you that you have shared this special information with us. I got some different kind of knowledge from your web page, and it is really helpful for everyone. Thanks for share it. testing and tagging Melbourne.

    ReplyDelete
  4. Valuable info, this information is excellent and essential for everyone. I am very very thankful to you for providing this kind of information. Mahindra 245

    ReplyDelete