He frequently rails against social media companies for what he sees as anti-conservative bias. Tech CEOs have left White House advisory board positions over opposition to Trump's environmental and immigration policies. And one company, Amazon, has sued the Trump administration claiming a defense contract was denied because of the President's animus against its owner.

But Tim Cook, the CEO of Apple, appears to be an exception.

Cook and Trump are close enough that Trump's daughter and senior adviser, Ivanka, laughed at the accidental nickname -- Tim Apple -- Trump once gave Cook. The President has tweeted suggestions directly to Cook about the next iPhone model. They're also friendly enough that Trump visited the liberal tech hub of Austin, Texas, on Wednesday to highlight American jobs at an Apple manufacturing facility.

Trump was asked earlier this year about why he has such a close relationship with Cook and not other tech leaders.

It turns out, it's all about face time with the President.

"Oh, I have it with everybody, but he's the one that calls me. You know why? That's why he's a great executive because he calls me, and others don't," Trump told reporters in August, shortly after a dinner with Cook. "Others go out and hire very expensive consultants, and Tim Cook calls Donald Trump directly. Pretty good. And I would take their call, too, but the only one that calls me is Tim Cook."

The President said Cook calls him "whenever there's a problem." In August, that problem, Trump said, was tariffs.

When it comes to congressional influence, Cook has fundraised for Republicans and Democrats, even though Apple has pared down its spending on lobbying over the last three years. He sits on the Trump administration's Workforce Policy Advisory Board, interfacing frequently with the White House over issues related to American jobs. And Apple has a lot of skin in the game over the future of policies which have been top of mind for Trump.

Trump's stop in Austin included touring a manufacturing facility where Apple contractor Flex Ltd. assembles Apple computers. The visit is meant to highlight the Trump administration's efforts to reinvigorate US manufacturing, but the cloud of US tariffs on Chinese goods loomed.

Ahead of his plant tour, Trump told reporters that the company is "spending a tremendous amount of money" to open its newest campus in Austin. Apple has said it will be investing $1 billion into the campus. He also said he's told Cook that the administration would "like to see Apple build here, that way you have no tariffs."

The Trump administration is currently considering whether to exempt certain Apple products from a 15% tariff on Chinese that took effect on September 1, according to Bloomberg . The company has already been exempted from some tariffs for its products.

While touring the manufacturing facility, Trump was asked whether he'll be exempting Apple from the tariffs at the company's request.

"We're looking at that and the problem that we have is that Samsung, it's a great company but it's a competitor of Apple. And it's not fair if, because ... we made a trade deal with South Korea, but we have to treat Apple on a somewhat similar basis as we treat Samsung," Trump said alongside Cook.

The Austin plant tour, the administration will likely argue, is partly a result of their tax cuts and economic policies.

CNBC reported that Cook relayed to administration officials in 2018 that the Trump tax cuts have been good for Apple's business. The cuts, Apple said in January 2018, would mean that Apple would repatriate billions of dollars in overseas money back to the US. The company also claimed it would "contribute" some $350 billion to the US economy over five years thanks to the cuts. It's unclear just how much progress Apple has made on its commitment, but Apple said in a statement Wednesday that it's "on track" to meet the goals it set out in 2018.

One of Cook's biggest points of opposition is the legality and necessity of the Deferred Action for Childhood Arrivals program. While Trump has expressed reluctance to support DACA recipients as a case on the issue is considered by the Supreme Court this fall, Apple filed a "friend of the court" statement in support of DACA. The company employs 443 recipients of DACA.

"We did not hire them out of kindness or charity," Apple said in the court filing . "We did it because Dreamers embody Apple's innovation strategy. They come from diverse backgrounds and display a wide range of skills and experiences that equip them to tackle problems from different perspectives."

Some other areas of tension between Apple and the administration include the environment and encryption.

Cook has criticized the Trump administration for the decision to exit the Paris climate accord. He wrote to Apple employees that he spoke to Trump to try and dissuade him from leaving the agreement.

And the Justice Department and Attorney General Bill Barr have asserted that encryption makes it more difficult for law enforcement to do their jobs, because it allows criminals to hide their communications behind encrypted apps like WhatsApp and Signal.

But Apple, the rest of the tech industry and privacy experts have argued that giving law enforcement special access to break encryption ultimately undermines everyone's security, especially when it comes to financial institutions.

Still, Cook's nickname and direct line to the President are quite a change from Trump's earlier views of Cook's company.

Trump's earlier impression of Apple, while he was running for president in 2016, seemed to be entirely painted by the company's position on encryption.