How to debug (check) GcmNetworkManager?

After this question I decided to use an alternative and after some research I found GcmNetworkManager which is backward compatible with 2.1 and all good, with alarm, if I change the device time, the alarm will be triggered, the question is:

How can I do this using GcmNetworkManager? I want to be able to force scheduled tasks to run.

Any ideas? thank.

+3


source to share


1 answer


You can run the debug task from the command line. Check at the end of the javadoc in the GcmNetworkManager class .

It is currently not possible to start the execution of a task scheduled by your application. There would be security concerns to expose a command line tool that will allow you to run tasks on an arbitrary GcmTaskService package.

However, as mentioned in the documentation above, you can run



adb shell dumpsys activity service GcmService --endpoints MyGcmTaskService

      

to get a general idea of โ€‹โ€‹what the network manager has for your service, whether it's ready, how many times this tag has run since boot, etc.

+3


source







All Articles