Smartphone photography is tolerated in outer areas but restricted during shalat, prohibited in the Rawdah, and professional cameras and drones are banned.
Photography rules inside the two holy masjids have evolved. Currently, casual smartphone photography is tolerated in outer courtyards and non-shalat areas. Taking a photo of the Kabah from upper floors is common. However, during active shalat times, photography is discouraged.
Restrictions: professional cameras and tripods are not permitted. The Rawdah in Madinah strictly prohibits photography. Video recording of other worshippers without consent is prohibited. Drone photography is absolutely prohibited and a serious legal offense.
From an etiquette perspective, scholars advise moderation. The primary purpose is spiritual devotion, not content creation. Take a few meaningful photos during non-shalat times and then put your phone away to focus on worship.