Bought mine for the 10.5 iPad Pro and at some point I started getting Accessory Not Recognized messages, then it would stop working unless I removed and reattached it, then it finally died entirely.
There are reports of similar experiences in the Apple Support Communities and on Reddit, and Apple reportedly created a program to replace some of the keyboards [1]. But when I contacted Apple I was told my keyboard was out of warranty — effectively $180 of electronic waste after just over one year of use.
[1] https://iphone.appleinsider.com/articles/17/05/08/apple-offe...