This claim can be traced back to a work of original Muslim scholarship by Muhammad Hamidullah, in his book Muhammad Rasulullah (1979). It appears that he grabbed a manuscript description out of the India Office catalog, in order to back up a legend he was familiar with. The catalog description is:
[Manuscript number] 2807 [...]
IV Foll[ios] 81-104. [Qissat Shakruti Firmad]. A fabulous account of the first settlement of the Muḥammadans in Malabar, under King Shakrûti of کوڈنگلور (Cranganore [Kodungallur]), a contemporary of Muḥammad, who was converted to Islam by the miracle of the division of the moon.'
When you try to ascertain the veracity of this "fabulous" story, things quickly become interesting. According to legend, the Cheraman Juma Mosque was built by orders of the king. However, the king never returned to Kodungallur, as he was buried in the city of Salalah in Oman, where pilgrims still visit his alleged tomb (apparently he is better known there by another name, Hazrat Syedina Tajuddin). The evidence of Indian presence in Salalah in the 7th century AD is scarce, but there is plenty of evidence that they came to Oman in large numbers starting in the 15th century, bringing their legends with them.
Following the link from Wikipedia's article on the mosque, one comes to an article on yet another name for this king, Cheraman Perumal, which apparently is not properly a king's name but the title of monarchs of an ancient dynasty. And from that page one arrives at Cheraman Perumal myths. Here we start to get the real story. Some people claim that Cheraman Perumal saw the splitting of the moon, converted to Islam, and went to Mecca. Others claim that he went to Mount Kailash (Tibet) or a Buddhist site. Still others claim that he was a Shaivist all along or that he converted to Christianity. Most fascinating to me is that the nascent film industry of Oman is sponsoring a film about his life as a Muslim, yet to be released. The one thing every faith community agrees on is that he was a good king, and now he has disappeared.
At this point it finally became obvious to me that this "fabulous" account was, indeed, fabulous. It was a local legend reflecting very old traditions about the Chera dynasty, which, thanks to the magic of the Internet, has now become a pan-Islamic myth about a witnessed miracle. I think that closes the case, but if you want more details on this legendary character, here's a talk in English about him. The speaker describes how longing for the lost dynasty, and its finest king whose historical existence is evidenced in a few stray inscriptions, inspired the telling of Shaivist legends about the king roughly 200 years later. These romantic legends may have inspired many different faith communities to come up with their own stories.