I faced the same incident, I cant claim from apple care as its not available in my country. Went to Apple and they advise me that I have to replace the whole backside of the phone at 2/4 of the price of a new unit or swap with a new one that cost 3/4 of the price of a new unit. I then scourge the internet and found something to fix it at minimal cost.
https://www.amazon.com/gp/product/B09HXSRS4J/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1
theres a youtube video that’ll guide you a step by step process.
Hope this helps!