Airdrop option not showing Finder in mac

I need to transfer files from my iphone to mac using airdrop.

But the airdrop tab is not showing in the finder sidebar. I tried finding the solution online on following links: https://support.apple.com/en-us/HT203538

https://discussions.apple.com/thread/8499248, but no luck.

Please suggest how can get the airdrop option back in my mac. I am using MacOS Mojave.


Solution 1:

Tried the following steps and it worked:

  1. First disable airdrop using:

    defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES
    
  2. Then enable airdrop using:

    defaults write com.apple.NetworkBrowser DisableAirDrop -bool NO
    
  3. Restart mac