A lot of Apple iPad Pro 12.9 users are getting “Device not supported” error while using the official Apple smart keyboard. This is a fairly common problem. The only solution is to get help from Apple for which they would need serial number. This serial number is located at the bottom of the keyboard. If the serial number is too small for you or worn out and you are unable to read the serial number, just take a photo of it and go to Apple store. Apple extended the period of warranty repair for the Apple Smart keyboard for iPad Pro 12.9 for up to three years. So if you take it back to the Apple store, they will repair or replace it. If you live in the US like me, you will get the replacement right away.
However, I am on my second one and while I love typing on this iPad Pro 12.9 smart keyboard, it was not meant to last. That is for sure. While I am unable to make out if this is a software or hardware problem, this is not an isolated issue.
To solve the issue temporarily, disconnect the keyboard from the iPad, reconnect and fold it up again for it to work.