Google has deprecated c2dm notifications. Should use gcm instead.
Updated solution.