If your iPhone has the version of iOS that supports "Shortcuts" then you can add a third-party water eject iPhone shortcut. On older versions, you will have to allow untrusted shortcuts first.