If you get an error message that says, "this accessory is not supported by your iPad/iPhone" when connecting your keyboard, it's usually the result of using an adapter that was not manufactured by Apple.
To connect to your iPad or iPhone, you must use a Lightning to USB Camera Adapter and it must be from Apple. Similar adapters from 3rd party manufacturers may work for a period, but eventually, they'll stop working and trigger the error message.
In some cases, the more powerful Lightning to USB 3 Camera Adapter is needed. This is typically only true for high-end digital pianos.