I will stop short of saying you're dumb, and simply note that you are incorrect in your thinking.
First, technically you would need the sun to get pudding no matter what type it was, because without it, Earth wouldn't generate sufficient heat to sustain life and everything to include its atmosphere would have completely frozen long, long ago.
No sun = no atmosphere warm enough to breathe = no water warm enough to exist in liquid form = no grass = no cow = no milk for pudding.
No sun also = no sunlight for cane or beets = no beets growing and making sugar through photosynthesis = no sugar for pudding.
So, no sun = no pudding in a variety of different ways.
Sticking specifically to the cacao plant, though, just because the cacao plant is not at the uppermost level of the rainforest canopy doesn't mean it gets NO sunlight. It just means it gets less sunlight. It's pretty obvious it still does get some, though. For instance, take a look at these cacao plants:
http://www.molon.de/galleries/Malaysia/WestCoast/Cocoa/images01/03%20Cocoa%20tree.jpg
http://www.hear.org/starr/images/image/?q=070321-6121&o=plants
http://www.panoramio.com/photo/21053508
http://rainforestkayaking.com/v2/wp-content/uploads/2009/02/078-cocoa-tree.jpg
Now, all of these images have a couple of things in common. We can quickly establish that the cocoa plant is a type of tree, that it tends to bear large fruit, and we can see in all those instances that the plants are sitting in an area where they will receive SOME sunlight, but even if they were wild, it would still be easy to tell they require sunlight to live because they all have one very important feature in common.
They all have thick canopies of broad, green leaves.
It takes a lot of energy to make a canopy of leaves like that, so they must serve some purpose that makes it worth the plant's while to spend that much energy, and the green color tends to tell us what that is.
All those green leaves are chock full of chlorophyll. Chlorophyll is what plants use to manufacture food through the process of photosynthesis. Photosynthesis requires sunlight in order to work...
Ergo, the cacao plant must use sunlight in order to make the food it needs to survive and produce the cacao fruit which contains the beans we turn into cocoa to make the chocolate pudding.
Finally, need the sunlight to dry and age the cacao beans once they've been harvested. Like coffee, they're not very good before we process them, and a large part of the process involves leaving them out in the sun so it can do its work on them.
So your friend is right. The sun is very necessary to the process.