Assuming a PoD in the late 20s or early 30s
On that note, there are really a lot of PODs to get a united India. Perhaps the cleanest way is to make the Montagu-Chelmsford Reforms part of a gradual and wholly peaceful transfer of power from the British to the natives. IOTL, the Government of India Act 1919 was considered a step in the right direction by Congress and resulted in cautious optimism. It turned the Imperial Legislative Council into a parliament broken up into an upper house, the Council of States (predominately appointed but some election), and a lower house, the Central Legislative Assembly (predominately elected but some appointment). Princely states had no elected seats. This system had some oddities, like both houses being led by Presidents who were similar to American Speakers in that they presided over the assemblies but were wholly partisan. Elections were restricted to the upper class. There were plans to revise the act every ten years, presumably expanding liberties every time. However, the Rowlatt Acts clamped down on the newfound Indian liberties and was a cause of the Jallianwala Bagh Massacre. The result was that Congress immediately refused all cooperation with the British and a breakaway faction, the Swaraj Party, entered the Imperial Legislative Council for the sole reason of obstructing legislation and getting home rule recognized. The Swaraj Party won the majority of elections and a Swaraj member even became President of the CLA.
The POD is that there are no Rowlatt Acts and therefore no Jallianwala Bagh massacre, and so Congress runs in the 1920 elections. It would, in any case, sweep the elections and therefore be uniquely posed to pass social reforms. The leader of Congress would become appointed President of the CLA. Conventions begin to set in, as Congress dissuades any attempts by the Viceroy to interfere in legislature, British Parliament begins to accept some Indian legislative independence and the President of the CLA increasingly gets considered the de facto Prime Minister of India. In the "Government of India Act 1929", the electorate is expanded as are the number of seats for election, giving full control of the CLA to Congress and its breakaways. And so on and so forth until by 1949 India is only united with Britain through the person of the monarch and has a fully patriated constitution. TTL's India would have an unwritten constitution, be fairly Anglophilic, and presumably would even keep the Star of India in its national flag (though without the motto). It may or may not be a monarchy, depending on how strong institutional inertia is. It would even have semi-official princes like Indonesia. But this is not only a bit dull and boring, but requires Britain to be reasonable about losing a colony to a degree it wasn't IOTL.