It’s no secret that among tech companies, Apple and Facebook have often had a love/hate relationship with each other. Now we’ve learned the two almost became outright enemies over HP’s discontinued TouchPad, according to an exclusive report by Mashable.

It was September 2010 when Apple’s now-panned Ping Music service debuted that the two companies began butting heads, at least publicly, for the first time. Beforehand, both worked closely together with one underlying goal – to beat Google.

Initially, Facebook was happy with Ping’s progress and allowed Apple to use its API within the service. However, at the same time, the two companies couldn’t agree with how integrated Facebook would be with Apple’s iOS 4.

According to Mashable:

Apple had fully integrated Facebook into the iPhone and iPad’s operating system, and was ready to launch the mobile-social fusion when API negotiations broke down. Apple, lacking confidence in Facebook’s ability to build a great application, asked to build its own Facebook for iPhone app. Facebook responded with a firm no. Negotiations came to halt.

Soon after, Facebook killed Apple’s access to the company’s API.

Three months ago, relations between the companies deteriorated further. It was then that Apple’s former CEO Steve Jobs visited with Facebook’s CEO Mark Zuckerberg. The topic at hand was when Facebook would finally release its iPad app.

Zuckerberg promised Jobs that the social network would release its first ever tablet application for iPad. Jobs, however, learned during his visit that HP was about to release a native webOS Facebook application for the TouchPad.

When Jobs learned of the webOS Facebook app during his summer visit to Facebook, he was livid. Zuckerberg vowed to get the app pulled. But Jon Rubinstein, the former CEO of Palm and then the GM of HP’s webOS division, refused to halt the release of the app. Facebook responded by restricting HP’s access to its APIs — just as it had done with Apple’s Ping, a year earlier.

With HP now feeling Facebook’s wrath, the freeze between it and Apple seems to be thawing. First, the Facebook for iPad app is likely to debut sometime next week. In addition, the two companies are said to be working closely on Facebook’s HTML 5 mobile app platform, Project Spartan.

The reason for the renewed friendship isn’t just because Facebook picked Apple over HP concerning the former’s app. Rather, Apple and Facebook recognized their real enemy was (still) Google.

As a reminding, Apple’s iPhone event is scheduled for 1 p.m. EDT on Tuesday. During that presentation, Facebook may debut its iPad app. We’ll keep you updated.