They (the Companions) accompanied the Prophet (ﷺ) while they were climbing the turning of a hill. A man uttered loudly: "There is no god but Allah, and Allah is most great" when he ascended the hill. The Prophet of Allah (ﷺ) said: You are not supplicating one who is deaf or absent. He then said: 'Abd Allah b. Qais. The narrator then transmitted the tradition to the same effect.
Sunan Abi Dawud Book 8, Hadith 112