Added optional handling for Apple's new APIs