One major problem in previous iOS versions is that there was no way to keep messages in sync between an iPad, iPhone, iPod touch, and Mac. If you deleted a message in the Mac app, it would not be deleted on your iPhone, and vice versa. Apple will be fixing this issue in iOS 11.4 by storing all of the messages in iCloud, not on individual devices.
By storing messages in iCloud, Apple is solving a huge issue. If you wanted to permanently delete a bunch of incriminating messages of your iPhone, you risk having them still reside on your Mac computer since deleting them on an iPhone will not delete them from the Messages app in macOS. Those messages can be hiding everywhere without you even knowing it.
This feature was first introduced at WWDC 2017 last June, and even appeared in an early iOS 11 beta as well as the iOS 11.3 betas, but had disappeared since then. And while this feature is fantastic for keeping Messages across your Apple devices synced, as well as saving you plenty of storage space, it isn't clear yet whether you can sync text messages in addition to iMessages. If not, we at least have an easy way to manage our iMessage threads and histories no matter how many iPhones, iPad, and Macs we may have.
First things first, your iPhone needs to be running iOS 11.4 in order to take advantage of Messages on iCloud. The update is not currently out yet, but is expected to arrive shortly for developers and public beta testers. If you're running the developer or public beta, you should have access from Settings –> General –> Software Update when it comes out.
Two-factor authentification is a security measure that uses one of your trusted devices to confirm your identity. In Apple's case, any time you sign in to service that uses two-factor authentication, one of your trusted devices receives a code that you must enter into the device using the service. If you only have one Apple device, that code is sent to that device.
You don't need to enable this security feature before activating Messages on iCloud, as Apple will walk you through the steps when you attempt to activate the new Messages feature (see Step 4 below). However, if you want to preemptively set up two-factor authentication. If you've ever used Apple Pay or Apple Pay Cash, you likely already have this done, since it's also a prerequisite for that.
Before proceeding, make sure to see how much free space you have on your iCloud account. If you have a free plan and a ton of attachments in your messages, it might not all fit.
To view how much space your Messages app is currently taking up, open Settings and go to General –> iPhone Storage. Once there, you can see how much storage "Messages" is taking up. Then, go back to the main Settings page and tap on your name up top, followed by "iCloud." There you will be able to see how much space you have available in iCloud.
Enabling this feature is simple. Open the Settings app, then tap the Apple ID settings with your name at the top of the page. On the Apple ID page, Tap "iCloud," then toggle on "Messages." If you have not set up two-factor authentication, Apple will walk you through the process here.
Once two-factor authentication has been enabled, the Messages icon should be as well. Don't be alarmed if Settings crashes — it seems to be a bug in the beta. Simply open Messages to complete the process.
Now, you won't notice anything different about Messages right away. Most of Messages on iCloud's features are under the hood. However, if you are running the iOS 11.4 beta on another device or if your Mac is running macOS 10.13.4 beta 1 (it needs to be enabled in the Messages settings), you'll notice what happens on one Messages app happens on the other.
If you enabled it on your iOS device already, you should get a prompt on your Mac to enable it. If not, open the Messages app, then click on "Messages" in the menu bar, followed by "Preferences." From there, click on the "Accounts" tab, and select the iMessage account listed on the left side of the window. If you haven't already, you may need to check the box that says "Enable this account." When that's good, check the box next to "Enable Messages on iCloud."
Delete a message on your iPhone? It's gone on your Mac. Wipe a thread completely from your iPad? You won't see it on any connected devices. Sure beats the old way of doing things.
Messages on iCloud will also save you storage space. Apple removes photos and attachments, as well as older messages from your device, and moves them to the Cloud. This frees up your device for other content, while making sure all of your information is backed up and safe.