Post via wp-admin and via iOS app, same hooks and triggers involved?
the update post function actually calls the insert function so it should work, now I’m not sure but try changing: if(!strlen($photo_url)){ to: if(empty($photo_url)){ since php strlen() returns 0 on an empty string.