How to Fix iPhone XS Charging Issue
Update: Apple has released iOS 12.0.1, which will fix the charging problem which users need to wake up iPhone XS or XS Max to charge.
There is a considerate number of users suffering from a charging issue with their new iPhone XS and iPhone XS. The iPhone XS/XS Max won't charge when it is asleep. Users have to wake it up - that is touching the screen or pressing the power button - before the device can detect the plugged in charging cable and start charging. In some worse cases, owners need to wake up their iPhone XS devices and replug in the devices. And in rare cases, asleep iPhone XS becomes dead when being plugging into a charger. The issues have been reported by users on Apple's support forums, MacRumors forums, Reddit, Twitter. Apple hasn't responded to the problem yet.
Is It A Software Issue?
There has been speculation that the charging issue on iPhone XS is related to a USB Accessories setting introduced by iOS 11.4, which limit the connection between iPhone, iPad, iPod Touch and a connected USB accessory if the iPhone, iPad, iPod Touch doesn't wake up for more than one hour. You can enable USB Accessories in locked mode in Settings > Face ID & Passcode. But some users reported that it didn't make a difference by charging the USB accessories setting.
More People tends to believe that this is a bug in iOS 12, given that some old models of iPhone, iPad also experience the same charging issue.
Currently, there is no effective fix to the iPhone XS charging issue yet. Here are fixes that some users found helpful.
Turn on Allow access when locked
Go to Settings > FaceID and Passcode > "Allow access when locked" and turn on USB Accessories. Even though Apple said that the USB Accessories setting has no effect on the charging on iPhone, iPad, iPod Touch, some users found it different.
Update iPhone XS to iOS 12.1
Since iPhone XS cannot charge properly because of bugs on iOS 12. Some users found that the iPhone XS can be charged when it is locked after updating to iOS 12.1. So it is worth a try.
Go to the Apple Store
The charging issue on iPhone XS can be a hardware one. Since your iPhone XS is still under warranty, Why not take it to the Apple Store and see what Apple can do?