Perhaps you can use the solution from this question.
The decision determines whether the battery of the device is charging, which, if it is connected to USB, will most likely be if it is not a third-party accessory, in this case, for those whom I consider, there is another SDK.
In any case, if the solution does not help, it can point you in the right direction.
UPDATE: A few more digging and it seems that this may be impossible , except for the previously mentioned solution for charging the battery.
So, to answer your question "Do I really need this api to find out if the iPhone is connected to a USB device?":
Yes, it looks like this.
source share