How to fix 1/2 inch gap between shower drain pipe and flange?
You should, if at all possible, take a look at what is going on below the shower. If there is a crawl space, basement or lower level floor you should look to see if the drain pipe has actually dropped down. I say that because there is a possibility that the original installer fitted the pipe to the drain collar but neglected to apply PVC cement into the joint. As a consequence over time the joint might have come apart and ended up the way you see it today. 

If the guess above is the case then this may be a relatively easy fix that would take two people to complete. First you would need to clean all grime, sludge and crap off the drain collar and the drain pipe. In the case of the drain pipe this would have to be done from below. Once clean and dry PVC cement would be applied to the outside of the drain pipe from below and the second person would install it to the inside of the drain collar from above. Then the person below would have to push the drain pipe up into the collar. It may take some up and down action on the pipe to get the PVC cement to spread and work its magic in the joint.