That looks like a good approach but you will need to add a build tag here
To stop it building on ios.
I'd suggest you return "ios", "unknown" if you can't fill in the correct details easily.