The apps told California voters to vote yes on Proposition 22. And the voters listened.

Uber and Lyft spent over $200 million on the ballot measure to keep their drivers classified as independent contractors, but their most effective bit of lobbying may actually have been just a few lines of code.

In the weeks leading up to Election Day, the companies used their respective apps to bombard riders and drivers with messages urging them to vote for Prop 22, the ballot measure. Its victory will set a precedent for other states’ labor laws around gig work, as well as for how huge companies with an easy way to communicate to millions of voters can lobby against laws they don’t like.

The outcome on Prop 22 was never certain, with polling in the run-up to the election showing the electorate sharply divided over whether Uber and Lyft should treat drivers like employees. Most notably, at least a quarter of voters said they were undecided just weeks before the vote, according to a UC Berkeley Institute of Studies poll. This gave Uber and Lyft an opportunity to define the issue to voters using their apps, said Arun Sundararajan, a professor at NYU’s school of business and author of The Sharing Economy: The End of Employment and the Rise of Crowd-Based Capitalism.

“I doubt whether the average voter would have weighed the pros and cons of the labor law around AB5 versus the new initiative,” Sundararajan said. “They feel positively towards the platforms, they don’t want to see a disruption in something that they depend on, and so they vote for the platform’s position.”

Prop 22 cements gig workers’ status in California as independent contractors. The ballot measure, which won with 58 percent of the vote, exempts gig economy companies from a state law requiring them to classify their workers as employees. It also mandates that gig workers receive new benefits, such as minimum hourly earnings. Critics say these benefits fall short of the full protections that come with employment, as they may have had to under another law, AB5 — which originally took aim at gig work.

The companies splashed out a historic sum that probably influenced the outcome. The companies’ “Yes on 22” campaign spent over $200 million on billboards, digital, print, and radio ads. They also deployed dozens of lobbyists, and sent voter mailers that critics said were misleading. At the same time, Uber and Lyft’s top executives undertook a media tour in which they threatened to leave the state if Prop 22 failed. And they even sponsored academic research to support their claims about the benefits of Prop 22. Labor groups, which opposed the law, raised only a tenth as much money.

It’s notoriously difficult to secure a yes vote on a ballot measure in California. Major companies have outspent their opponents by tens of millions of dollars and still come up short. In 2010, for example, PG&E spent $43 million to pass a measure to deter government-run power providers, but the measure was defeated by a large margin.

But the gig companies’ digital reach and their use of in-app messages to reach voters was unique, setting it apart from ballot fights of the past. In the weeks leading up to the vote, Uber and Lyft served users with a pop-up message threatening longer wait times and higher prices if Prop 22 failed. They also claimed drivers would lose their livelihoods. In order to request a ride, users had to tap the “confirm” button on the message.

Uber and Lyft’s use of their apps to push a political message may be legal, but it still felt improper, said Erica Smiley, executive director of Jobs with Justice, a nonprofit that opposed Prop 22. “If anyone else collected data from people for one reason, and then used it for another political purpose, they would be in a world of trouble,” she said.

The fight was certainly asymmetrical. Anti-Prop 22 groups were able to fund a modest ad campaign arguing against the ballot measure, but lacked direct access to voters through their smartphones.

Uber was also lobbying its drivers through the app. In a lawsuit filed recently, Uber drivers accused the company of pressuring them to support Prop 22 through the app. The drivers claimed they were getting messages reading “Prop 22 is progress,” as well as dire warnings about what would happen to their jobs if Prop 22 were to fail. Like riders, drivers had to click “OK” before they could move forward in the app. A judge rejected the lawsuit on the grounds that the outcome of Prop 22 would render it “moot.” The judge also dismissed the drivers’ allegations of “political coercion,” stating that there was no evidence of any Uber driver being punished for not supporting Prop 22.

This isn’t the first time Uber wielded its app to score a political victory. In 2015, the company was feuding with New York City Mayor Bill de Blasio over his effort to limit the number of new ride-hail vehicles on the road. To marshal its user base to oppose the mayor, Uber added a “DE BLASIO” option that illustrated how ride requests could vanish and vehicles could slow to a crawl if the mayor’s proposal was approved.

Other tech companies have embedded political messages in their products before. In 2012, Google blacked out its logo on its search page in protest against the Stop Online Piracy Act (SOPA) and the PROTECT IP Act (PIPA) that passed the House of Representatives.

“Different tech platforms have tried to engage consumers through their tech in different ways,” Sundararajan said. “But Uber is probably among the most sophisticated at using the app, and it was particularly important in this case, given that it was a ballot initiative.”

Jobs with Justice’s Smiley argues for stricter laws around companies using apps to push political messages. “They have to create separate political PACs to be able to talk to consumers or workers,” she said, “and build those lists based on that premise, not based on the need to fulfill a service.”

Uber’s messages to riders and drivers are not considered political advertisements, though the Yes on 22 campaign still included them in a disclosure statement as a non-monetary contribution, a spokesperson for the company said. “Uber’s app shared the voice of tens of thousands of drivers, 72 percent of whom support Prop 22, with millions of riders in California and keeping them informed of the stakes on this issue,” the spokesperson said in a statement. “We have previously shared videos from drivers with riders and this week MADD’s endorsement of prop 22 because of ridesharing’s impact on reducing drunk driving.”

A Lyft spokesperson did not immediately respond to a request for comment.

It’s unclear whether states will step in to restrict these types of mass-messaging campaigns. In California, app notifications appeared to be fair game. In a statement to the LA Times, the state’s Fair Political Practices Commission said political advertising only needs proper disclosure to let the public know who’s paying for it to be in compliance with the law.

The pro-Prop 22 notifications on Uber’s app included a small line of gray print reading “paid for by Uber.”

*By Andrew J. Hawkins via The Verge*