The MagSafe charger is primarily designed to work with the iPhone 12 series and newer models, as these devices have built-in magnets that help align and secure the charger to the back of the phone. Unfortunately, the iPhone XR does not have the necessary magnets to support the same level of attachment.
While you can still use the MagSafe charger with an iPhone XR, it won't stick to the back of your phone like it would for the iPhone 13 or other compatible models. You'll need to place the MagSafe charger on the back of your iPhone XR and ensure it aligns properly with the wireless charging coil. Although it won't have the same magnetic connection, the charger should still work to charge your iPhone XR wirelessly.
If you decide to buy a MagSafe case for your iPhone XR, it might offer a slightly better alignment and attachment for the charger, as these cases usually have magnets embedded in them to enhance the magnetic connection. However, it's important to note that the attachment won't be as strong as with the iPhone 12 series or newer models.
The bottom line? If you really want to use MagSafe, you should consider upgrading your iPhone to a newer model that will be better suited for it.