MENLO PARK (CBS / AP) — The Supreme Court on Thursday sided with Facebook in a lawsuit over unwanted text notifications it sent, rejecting a claim that the messages violated the federal ban on robocalls.

The high court’s ruling for the Menlo Park-based social media giant was unanimous.

READ MORE: Fresno Search And Rescue Team Finds Palo Alto Hiker Missing For 48 Hours

The case was brought by a man who received text messages from Facebook notifying him that an attempt had been made to log in to his account from a new device or browser. The man, Noah Duguid, said he never had a Facebook account and never gave Facebook his phone number. When he was unable to stop the notifications, he filed a class action lawsuit.

The court case had to do with the Telephone Consumer Protection Act, a 1991 law that bars abusive telemarketing practices. The law restricts calls made using an “automatic telephone dialing system,” a device that can “store or produce telephone numbers to be called, using a random or sequential number generator” and then call that number.

The question for the court was whether the law covers equipment that can store and dial telephone numbers even if the equipment does not use a random or sequential number generator.

READ MORE: Man Wanted In Vallejo Fatal Shooting Arrested

Justice Sonia Sotomayor wrote for the court that it does not.

Facebook had argued the lawsuit should be dismissed because Duguid had not claimed Facebook was sending messages that were randomly generated. Facebook said it sends targeted, individualized texts to numbers linked to specific accounts. A trial court agreed, but an appeals court reversed that decision.

Facebook said it was possible Duguid’s cellphone number previously belonged to a Facebook user who opted to receive login notifications.

The case is Facebook v. Duguid, 19-511.

MORE NEWS: 'It’s A Big One'; Weekend Atmospheric River Gaining Intensity Off California Coast

© Copyright 2021 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.