Skip to main content

Cannot start load of Task ~~ since it does not conform to ATS policy

Image by Faysal Khan from Pixabay



This is a solution to the runtime error “Cannot start load of Task <~~>.<1> since it does not conform to ATS policy” when communicating via http in Swiftui.


The cause is that http was used when communicating on iOS.





https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity


In other words, this problem would not have occurred if https was used. However, there are times when you need to use http for various reasons.

If you need to use http for testing, etc., you can change the settings in info.plist.



Add App Transport Security Settings.


Then select Allow Arbitrary Loads and set the value to YES. This will allow iOS to use http when communicating.

One thing to note at this time is that you must click “>” to change it to “﹀”. Then it can be set as a sub-property of App Transport Security Settings.


If you only want to allow http access to specific sites (including subdomains), you can do this as follows:


For reference, here's how to set the Exception Domains spec and domain name.

NSExceptionDomains : Dictionary { 
    <domain-name-string> : Dictionary { 
        NSIncludesSubdomains : Boolean 
        NSExceptionAllowsInsecureHTTPLoads : Boolean
        NSExceptionMinimumTLSVersion : String
        NSExceptionRequiresForwardSecrecy : Boolean
    }
}

Follow these rules when setting a domain name string:

  • Use lowercase. Use example.com, not EXAMPLE.COM.
  • Don’t include a port number. Use example.com, not example.com:443.
  • Don’t use numerical IP addresses. Don’t use 1.2.3.4. For information about how ATS handles IP addresses, see NSAllowsLocalNetworking.
  • Don’t include a trailing dot, unless you only want to match a domain string with a trailing dot. For example, example.com. (with a trailing dot) matches “example.com.” but not “example.com”. Similarly, example.com matches “example.com” but not “example.com.”.
  • Don’t use wildcard domains. Don’t use *.example.com. Instead, use example.com and set NSIncludesSubdomains to YES.




Additionally, we will introduce how to set up Exception Domains.


If you add an item (click "+") as a child of Exception Domains (click ">"), "New item" will appear.

Enter your desired domain name here.


속성을 String -> Dictionary로 변경합니다. 그럼 "www.domain.com" 앞에 ">"가 생깁니다.


If you click an item (click "+") as a child of the added domain name (click ">"), "New item" will appear.

Enter "NSExceptionAllowsInsecureHTTPLoads" here. Then change the property from String -> Boolean and then change the value from NO -> YES.


You can also use the NSIncludesSubdomains option, which allows subdomains, in the same way as above.











Comments

Popular posts from this blog

Economy Insights for October 23, 2025

  Economy Insights for October 23, 2025 ⚠️ Disclaimer : This content is a personal opinion based on publicly available economic indicators. All investments should be made under your own judgment and responsibility. https://www.cnbc.com/2025/10/21/stock-market-today-live-updates.html Global Market Status: Mixed Sentiment Amid US-China Trade Talk Hopes On October 23, 2025, global financial markets exhibited a mixed sentiment , oscillating between anticipation for US-China trade negotiations and persistent uncertainties. While President Trump expressed optimism about securing a favorable trade deal with China, the market is maintaining a cautious stance, especially with the meeting with President Xi Jinping remaining unconfirmed. Investor anxiety is further compounded by the ongoing US government shutdown, which has led to delays in the release of key economic data. The following sections analyze the latest market trends and economic indicators, along with a future outlook. 1. Stock M...

subtle rise in inflation—will the anticipation for a rate cut still hold?

 Hello there, fellow investor. The U.S. economy is currently at a very interesting crossroads. Recent economic data reveals a subtle yet significant tug-of-war between inflation and economic growth, leaving many to wonder about the Federal Reserve's next move. Key Economic Indicators and the Current Situation According to the latest Personal Consumption Expenditures (PCE) price index , annual inflation rose to 2.9% in July, a slight increase from June's 2.8%. While this aligns with market forecasts, it remains stubbornly above the Fed's 2% target. Core PCE, which excludes volatile food and energy prices, has now been above this target for 53 consecutive months. This inflationary pressure is partly attributed to the tariff policies implemented by the Trump administration, which have started to filter into consumer prices. However, it's not all about inflation. The U.S. economy still shows remarkable resilience. The second-quarter GDP growth exceeded expectations at 3.3%...

Today's Economic Insights - July 1, 2025

  Today's Economic Insights - July 1, 2025 ⚠️ Disclaimer: This content represents personal views based on publicly available economic indicators. All investments should be made based on your own judgment and responsibility. https://www.bbc.com/news/articles/c62553ywn77o Global Market Overview: Rally Amid Trade Progress and Monetary Policy Expectations On the final day of the first half of 2025, global financial markets closed strong, buoyed by progress in U.S. trade negotiations and expectations of accommodative monetary policies from major central banks. Canada's scrapping of its digital services tax and a new trade agreement with China significantly reduced market uncertainties. However, the approaching July 9 deadline for President Trump's tariff reprieve and concerns about economic growth slowdown across major economies remain key market variables. 1. Equity Market Performance United States (S&P 500) Both the S&P 500 and Nasdaq 100 gained 0.5%, reaching ne...