One day, When Khwaja Moinuddin Chishty (R.A) was absorbed in prayer in Kaaba,he heard a voice saying
“O Moinuddin I, we are greatly pleased with thee. Thou art given salvation.Ask for anything thou mayst like,so that we may grant that to thee,”
He Submitted respectfully: “O Great God I give salvation to the followers & disciples of Moin-ud-Din.” Came the reply: O Moin-ud-Din! thou art our accepted one. I will give salvation to thy followers and disciples and also to those who may enter thy fold till the day of resurrection. 
After paying pilgrimage to Kaaba and performing the Hajj,Khwaja Moinuddin Chishty (R.A) reached Medina. Here,he was engaged in prayers in the Quba Mosque. During this time he received the direction from the court of the Holy Propeht Muhammed (Peace be upon them) to the effect-:
” O Moin-ud-Din! thou art helper of my religion. I entrust to thee the country of Hindustan (India). Proceed on to Ajmer and spread there the Gospel of Truth”.
Receiving this mandate, Khwaja Gharib Nawaz (R.A) was immensely pleased but wondered as to where Ajmer was situate.
In the meanwhile, he felt drowsiness. he was blessed by seeing Holy Prophet Muhammed (Pecace be upon them) in dream ,who showed him the city, the fort and the situation of Ajmer. Khwaja Gharib Nawaz (R.A) was bid farewell by giving him a pomegranate from heaven.
Reference : 15. Sair-ul-Aqtab , pp. 103-104