Make sure the topic is created AND make sure you've correctly setIamPolicy on it. Do NOT use API explorer on it as advised by other answer. Do those Cloud Pub/SUb calls as it says in the guide (using your own service-account client) :
https://developers.google.com/gmail/api/guides/push