Crashing New Relic

There are many analytics and crash reporting services available for mobile platforms like Firebase, Microsoft App Center, New Relic, Apteligent, Instabug, Bugsnag, & Bugsee. Although Apple provides crash reporting through Xcode, many crashes go unnoticed as crashes are only uploaded if the device has developer analytics turned on and they are backing up their device, so developers choose to use these services so that they always get performance and error data to make their applications better....

Anti-Debugging

When developing apps, the debugger is your friend. When your app is running in production, the debugger is your enemy. To protect applications, sometimes developers put in code that only runs in non-debug mode that prevents debugger attachment or ends program execution once one is attached. This is a game of cat and mouse for those persons who like working around these limitations. Using ptrace One of the simplest solutions is to use ptrace....

Disappearing SFAuthenticationSession

If you have an iOS application that contains sensitive information, you should be obscuring it somehow when the user leaves the application so that the system does not save a screenshot of the content and so that it is not viewable in the app switcher. Typically, you would do this by replacing the view hierarchy of the application’s window with a view controller with some static content and then restore it when the user returns....

Monitoring Network Changes

Whether it is Wi-Fi or LTE, most people have near constant access to a high-speed network. However, there are times when you have either no network access or are on a degraded connection. Therefore, it is important to adjust the behavior of your application(s) to handle the change in network capabilities. Luckily, Apple provides a few ways of obtaining information about the network the device is connected to. The Old Way The original framework of providing information about the device’s network configuration is the SystemConfiguration framework....

Implementing TLS Pinning with NSURLSession

With the advent of App Transport Security in iOS 9 and macOS 10.11, Apple began pushing developers into using more secure transportation channels for their applications' data. When an application is linked to those SDKs, the underlying networking stack enforces ATS compliance and the application becomes more secure. ATS’s requirements are quite easy to satisfy: Connections use HTTPS instead of HTTP Servers must present a certificate from a valid Certificate Authority The certificate must be signed with a RSA 2048+ bit or an ECC 256+ bit key The certificate must have a Secure Hash Algorithm 2 (SHA-2) digest of at least SHA-256 The certificate must be present in the Certificate Transparency (CT) logs The connection must use Transport Layer Security (TLS) 1....