The method NfcAdapter.setNdefPushMessage() has been deprecated and removed in newer Android versions. That’s why Android Studio shows an error — it no longer exists in the current SDK.sadly there isn’t a direct replacement for peer‑to‑peer NDEF push. Instead, you need to use the newer NFC APIs depending on your use case.
You can import the latest npm package of NFC where this method is removed, I check it in NPM Home so updating the npm package should work.
I hope it helps