I am totally lost in this point I have finished my subscriptions payment from android application and I need to listen for any subscription on my own backend server to give subscriber the service, but I don't know how to make this happen in proper way, if any one had experience in this point please help .
I haven't find any thing useful in google documentation or YouTube .
thanks
I need step by step to make it work.
CodePudding user response:
- You need to enable PUB/SUB API in your project; check this quick guide and also ensure that you have selected Android Management API is enabled.
- Once you have enabled the API you need to create a topic which can publish notifications. You can do it manually in GCP console and by using Pub/Sub topic method
- Now you need to create a subscription which captures the stream of messages published. check create subscription method.
- Grant Android device policy and you cand do them manually from console or by Pub/Sub; check this.
- You need to call enterprises.patch to specify the below parameters
pubsubTopic: projects/{project}/topics{topic}. enableNotificationTypes: ENROLLMENT, STATUS_REPORT and COMMAND.
- You can use Pub/Sub API to get notifications.