If it's not made by Apple or certified by Apple this message will appear more often than not. Apple doesn't want you to use non-Apple certified accessories. Your iPhone will know if the cable is complaint or not (at least most of the time.)
I hope this helps.
Really upset with Apple and I have been a loyal Apple guy since the 1980's. I went to use the new lightning connector with my traditional headphone jack the other day and in less than 2 minutes I got this message on my iPhone 8: "This accessory is not supported by this iPhone" and yet I have a shorter version of the same connector and it works fine. I am using Apple Headphones. Anyone had the same experience?