# Facebook for iOS: From HTML5 to Native in 2012 | gen2.dev

> Facebook rebuilt its HTML5-based iOS app as a native app in nine months and shipped it in August 2012, twice as fast. Why the first bet failed.

Source: https://gen2.dev/cases/facebook-native-ios/

---

Case file 31

# Facebook for iOS: the HTML5 app rebuilt as a native one

Facebook built its iOS app around HTML5 so that one set of code could reach every phone. The app was slow. In 2012 a team rewrote it in native code in nine months, shipped it as an ordinary update, and the company's chief executive said in public that the first approach had been a mistake.

![Slide: the HTML5 Facebook app taking up to 10 seconds to open, rewritten in about nine months, and Facebook 5.0 twice as fast.](https://gen2.dev/img/case-facebook-native-ios.png)

[Evernote 10](https://gen2.dev/cases/evernote/) replaced five native apps with shared web technology. Facebook made the opposite move eight years earlier, and it is one of the few rewrites where the person in charge described the first generation as a mistake while on stage.

## Gen 1

Facebook's mobile strategy before 2012 was to write once in HTML5. The engineering post that announced the rewrite put it this way: "we leveraged HTML5 to build and distribute Facebook mobile experiences across iOS and other platforms." The same post gives the scale that made the idea attractive: "more than 500 million people using Facebook on more than 7000 supported devices."

HTML5 had a second advantage. Changes could reach users without an app update.

Mick Johnson, the product manager for the iOS app, described the choice to TechCrunch as deliberate: "We deliberately made a trade off to get to scale."

The cost of the trade was speed. TechCrunch reported that the news feed could take up to 10 seconds to appear when the app was opened. The engineering post is blunt about where that left the product: "people expect a fast, reliable experience and our iOS app was falling short."

## The decision

The decision was to stop improving Gen 1 and start again. In the words of the engineering post: "we rewrote Facebook for iOS from the ground up." The team started a new Xcode project.

Johnson gave the reasoning to TechCrunch. HTML5 worked in the browser, he said, but people "have different expectations of a native IOS app."

Two limits were set on the rewrite.

-   **It was not all of Facebook.** The mobile website stayed. Johnson said it drew "two times the mobile traffic" of the iOS and Android apps combined.
-   **It was not all of the app.** The engineering post says: "For areas within the app where we anticipate making changes more often, we will continue to utilize HTML5 code."

The rewrite also dropped an old dependency. Three20, the open source framework that had come out of Facebook's earlier iPhone app, had "started to feel long in the tooth," and the new app was the first release in years without it.

## What happened

Johnson told TechCrunch: "we rebuilt the app from scratch over the last 9 months and the main improvement is performance."

Facebook 5.0 for iOS was announced on August 23, 2012, and reached users as an App Store update. There was no period of two apps side by side. The company's announcement said: "Facebook 5.0 for iOS is twice as fast as the previous version when launching the app." The same improvement was claimed for scrolling the news feed and opening photos.

The engineering post explains where the speed came from. The app now showed cached content at once instead of waiting for the network, on the principle that "you want to see your news feed, not a loading spinner." Networking, parsing and writing to disk were moved off the main thread. TechCrunch's reporter measured the news feed appearing in about four seconds.

The rewrite also joined two codebases. The Messages tab ran the same code as the standalone Facebook Messenger app.

Nineteen days later, on September 11, 2012, Mark Zuckerberg was interviewed at TechCrunch Disrupt. As quoted by The Register, he said "the biggest mistake that we made as a company is betting too much on HTML5 as opposed to native." He added: "We burned two years."

He did not blame the technology itself. "It's not that HTML5 is bad," he said. "We just never were able to get the quality we wanted". TechCrunch reported his figure for the result: people were consuming twice as many feed stories since the new iOS app.

He also said the job was not finished. VentureBeat quoted him on the new app: "even what we have now isn't as good as it can be."

Android followed. On December 13, 2012, Facebook's engineers described "moving from a hybrid native/webview to pure native code" in the Android app, after having "shipped a native re-write of Facebook for iOS."

## What made it work

-   **The goal was one thing.** Johnson named performance as the main improvement. The release did not try to add a new product at the same time.
-   **The rewrite covered the screens people used most.** News feed and the other core screens went native. Parts expected to change often stayed HTML5.
-   **It was an update, not a new product.** It arrived as version 5.0 of the same app.
-   **Gen 1 was not being thrown away everywhere.** The mobile website, which had more traffic than both apps combined, kept running on the web technology the app was leaving.
-   **The cause of the slowness was understood.** The engineering post lists specific work moved off the main thread, not a general hope that native code would be faster.

## The verdict

Worked. The rewrite took nine months, shipped on a single day, and delivered the speed it was built for. The company applied the same decision to Android within four months.

Two qualifications belong on the record. First, by Zuckerberg's own count the HTML5 bet cost two years before it was reversed. Second, the rewrite was not the end of the work. A later engineering history records that in 2014 the news feed code "began to have reliability issues," and the team built a new user interface framework to fix it. That migration brought "a 50 percent performance improvement."

## What to take from it

-   **A trade made to reach scale has to be revisited once scale is reached.** HTML5 was a reasonable way to cover 7000 devices. It was the wrong way to serve the largest single platform.
-   **Rewrite the part that is failing, not everything.** Facebook kept its mobile website and kept HTML5 inside the app where it helped.
-   **Give the rewrite one measure.** "Twice as fast" could be checked by anyone who opened the app.
-   **Say the first decision was wrong.** The public statement made the direction clear to the company's own engineers and to the developers who build on it.
-   **Expect a second round.** The rewritten app needed new architecture two years later. A rewrite buys time, not permanence.

## Sources

1.  [Jonathan Dann - Under the hood: Rebuilding Facebook for iOS (Facebook Engineering, August 23, 2012)](https://engineering.fb.com/2012/08/23/ios/under-the-hood-rebuilding-facebook-for-ios/) - the engineering account: why HTML5 was used, why the app fell short, what was rebuilt and what stayed HTML5
2.  [Mick Johnson - A Faster Facebook for iOS (Facebook Newsroom, August 23, 2012)](https://about.fb.com/news/2012/08/a-faster-facebook-for-ios/) - the release announcement and the speed claim for Facebook 5.0
3.  [Josh Constine - Facebook For iOS App Is Now 2X Faster (TechCrunch, August 23, 2012)](https://techcrunch.com/2012/08/23/facebook-for-ios-faster/) - interview with product manager Mick Johnson: the trade-off, the nine months, mobile web traffic, launch times
4.  [Joanna Stern - Facebook's iPad and iPhone App Just Got Faster (ABC News, August 23, 2012)](https://www.goodmorningamerica.com/news/story/facebook-50-ios-facebook-ipad-iphone-app-faster-17066040) - the nine-month figure and Johnson's remark about Android
5.  [Drew Olanoff - Mark Zuckerberg: Our Biggest Mistake Was Betting Too Much On HTML5 (TechCrunch, September 11, 2012)](https://techcrunch.com/2012/09/11/mark-zuckerberg-our-biggest-mistake-with-mobile-was-betting-too-much-on-html5/) - Zuckerberg at TechCrunch Disrupt: the mistake, and feed stories consumed after the new app
6.  [Matt Asay - HTML5 isn't Facebook's 'biggest mistake' (The Register, September 14, 2012)](https://www.theregister.com/2012/09/14/facebook_html_5_vs_native_apps/) - Zuckerberg's statements at Disrupt quoted at length
7.  [Devindra Hardawar - Facebook's Zuckerberg: 'The biggest mistake we've made as a company is betting on HTML5 over native.' (VentureBeat, September 11, 2012)](https://venturebeat.com/mobile/facebooks-zuckerberg-the-biggest-mistake-weve-made-as-a-company-is-betting-on-html5-over-native) - Zuckerberg on the new app's quality and on why Facebook did not drop the mobile web
8.  [Frank Qixing Du - Under the Hood: Rebuilding Facebook for Android (Facebook Engineering, December 13, 2012)](https://engineering.fb.com/2012/12/13/android/under-the-hood-rebuilding-facebook-for-android/) - the Android app following the same path four months later
9.  [Dustin Shahidehpour - The evolution of Facebook's iOS app architecture (Engineering at Meta, February 6, 2023)](https://engineering.fb.com/2023/02/06/ios/facebook-ios-app-architecture/) - what happened to the rewritten app afterward, including the 2014 news feed work

Last updated November 28, 2026.

## Scorecard

Worked

Gen 1

Facebook for iOS before version 5.0: an app built largely on HTML5, the web technology Facebook used across mobile platforms

Gen 2

Facebook 5.0 for iOS, released August 23, 2012: news feed and the other core screens written in Objective-C

Approach

Rewrite the app from the ground up in native code, keep HTML5 for the parts that change most often, and release it as a normal App Store update

How long

Nine months, shipped August 23, 2012

Verdict

The rewrite shipped in nine months, made the app twice as fast, and was followed by the same move on Android four months later.

## More case files

-   [Netscape 6](https://gen2.dev/cases/netscape-6/)
-   [Python 2 to 3](https://gen2.dev/cases/python-2-to-3/)
-   [Firefox Quantum](https://gen2.dev/cases/firefox-quantum/)
-   [Perl 6 and Raku](https://gen2.dev/cases/perl-6-raku/)
-   [AngularJS to Angular](https://gen2.dev/cases/angularjs-to-angular/)
-   [Windows Longhorn](https://gen2.dev/cases/windows-longhorn/)
-   [Digg v4](https://gen2.dev/cases/digg-v4/)
-   [Twitter to the JVM](https://gen2.dev/cases/twitter-jvm/)
-   [Basecamp](https://gen2.dev/cases/basecamp/)
-   [IPv4 to IPv6](https://gen2.dev/cases/ipv6/)
-   [VB6 to VB.NET](https://gen2.dev/cases/vb6-to-vb-net/)
-   [HTTP/2 and HTTP/3](https://gen2.dev/cases/http-2-and-3/)
-   [K-12 browser rewrite](https://gen2.dev/cases/k12-browser-rewrite/)
-   [Mac OS X](https://gen2.dev/cases/mac-os-x/)
-   [Microsoft Edge](https://gen2.dev/cases/edge-chromium/)
-   [Winamp3](https://gen2.dev/cases/winamp3/)
-   [Slack desktop](https://gen2.dev/cases/slack-desktop/)
-   [Evernote 10](https://gen2.dev/cases/evernote/)
-   [Uber rider app](https://gen2.dev/cases/uber-rider-app/)
-   [HealthCare.gov](https://gen2.dev/cases/healthcare-gov/)
-   [Thunderbird Supernova](https://gen2.dev/cases/thunderbird-supernova/)
-   [Skype](https://gen2.dev/cases/skype-cloud/)
-   [Sonos app (2024)](https://gen2.dev/cases/sonos-app-2024/)
-   [FBI Virtual Case File](https://gen2.dev/cases/fbi-virtual-case-file/)
-   [LinkedIn Inversion](https://gen2.dev/cases/linkedin-project-inversion/)
-   [Netflix to AWS](https://gen2.dev/cases/netflix-cloud-migration/)
-   [TSB migration](https://gen2.dev/cases/tsb-migration/)
-   [Phoenix pay system](https://gen2.dev/cases/phoenix-pay/)
-   [Universal Credit](https://gen2.dev/cases/universal-credit/)
-   [Queensland Health payroll](https://gen2.dev/cases/queensland-health-payroll/)
-   [New Microsoft Teams](https://gen2.dev/cases/microsoft-teams-2/)
-   [Dropbox to Python 3](https://gen2.dev/cases/dropbox-python-3/)
-   [Instagram to Python 3](https://gen2.dev/cases/instagram-python-3/)
-   [Discord Go to Rust](https://gen2.dev/cases/discord-go-to-rust/)
-   [Reddit Redesign](https://gen2.dev/cases/reddit-redesign/)
-   [GetPranks](https://gen2.dev/cases/getpranks/)
-   [37signals cloud exit](https://gen2.dev/cases/37signals-cloud-exit/)
-   [IRS Individual Master File](https://gen2.dev/cases/irs-individual-master-file/)
-   [GitHub Rails upgrade](https://gen2.dev/cases/github-rails-upgrade/)
-   [Knight Capital](https://gen2.dev/cases/knight-capital/)
-   [NHS National Programme for IT](https://gen2.dev/cases/nhs-national-programme-for-it/)
-   [Air Force ECSS](https://gen2.dev/cases/air-force-ecss/)
-   [Java SaaS upgrade](https://gen2.dev/cases/java-saas-upgrade/)
-   [ActiveX to WebRTC](https://gen2.dev/cases/activex-to-webrtc/)
-   [All case files](https://gen2.dev/cases/)
