Modified the iOS plugin code and corrected errors by testing it