iOS 9 Error: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

With the release of iOS 9 this week, there’s some changes to the development of the application.

If you are writing an app now and it calls certain external api or webservices, you will hit the following error.

The resources could not be loaded because the App Transport Security policy requires the use of a secure connection.

There are 2 solutions to this, first make sure that the connection you are trying to make support https. Change that in your codes and build, if error persist.

The second solution is to add a new value to the Info.plist in your solution file.

Add a Key called NSAppTransportSecurity as a Dictionary

Add a sub-key called NSAllowsArbitraryLoads as Boolean
and set its value to YES.

Adding Google Analytics to your wordpress

So last night I decided to add the Google Analytics to my blog and see what the most rewarding post/s.

1. Visit www.google.com/analytics to sign up with your Google Account.

2. You need to accept some T&A before continuing the process.

3. Add a new Website, enter your domain name.

4. Now, Google will generate a tracking code for you to input into your webpage.

Something like this,

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘XXXXXXXXX’, ‘auto’);
ga(‘send’, ‘pageview’);

</script>

 

To insert that into your wordpress blog, use the following plugin, https://wordpress.org/plugins/insert-headers-and-footers/

GoogleAnalytics