I see you are using hardcoded directory paths (which are essentially Android-based)
That can answer the query as to why it works on Android and not on iOS.
For this, it is recommended to use a library that’s compatible with your platform and serves the purpose of getting your platform-specific directory. eg path
Secondly, there’s no invocation code for this function, but I do see a file picker imported, so it would be best to probe further based on your code, which you haven’t furnished yet.