Improve iOS 7 and cordova code