Potentially, how to fix "Accessory Not Supported" error with iPad keyboard
I started getting this with my Apple Smart Keyboard, for my 10.5 iPad Pro recently and it's starting to annoy me, so ...
What to do when you get this error
How to Fix When Your iPad’s Smart Keyboard is Not Working.
Several good ideas here.
Another article that I read supports the magnet issue (it was in 2016 and I can't find it now, so ... sigh). But one thing it said that this one doesn't is that you can "rub the keyboard above the 1/2 keys", and that is apparently where this switch is and that works sometimes without needing to disconnect the keyboard.
I got the message and tried it and it seemed to work. Read this iPad Pro Keyboard "This accessory is not supported by this device" and look at the answer by iPodge (I'll put it below as well).
iPodge Apr 6, 2017 11:26 AM in response to mugsymallone
I had all all this nonsense with my iPad Pro and its keyboard after about a years use. Seems the thing that activates the keyboard is a small reed switch (I am guessing) in the guttering just above the keyboard. When you snap the keyboard together ready for typing a magnet on the oposing face triggers the switch. Try it out! With the keyboard attached but not in the support guttering get a small magnet and rub it just above the 1 and 2 keys on the keyboard. If you are in an application that is waiting for input the onscreen keyboard will dissapear meaning that the physical keyboard is ready for typing.
What is clearly happening is that the magnetic strength of the top part which fits in the guttering has lost flux. Get that magnet which you were playing about with just a moment ago and rub it on the top part of the keyboard which mates with the guttering. Magnet flux is restored and the final act of snapping the keyboard to typing position should activate the switch. Works for me! I used a neodymium magnet, BTW.
This was from the same article but lower down - still by iPodge:
Something else which also helps is to lower the iPad onto the keyboard right hand side first and then drops the left to meet. This is where I think the switch lies (Just above keys 1 and 2).